This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: [PATCH 3/3] Use latest <semaphore.h> from FreeBSD for RTEMS
- From: Sebastian Huber <sebastian dot huber at embedded-brains dot de>
- To: newlib at sourceware dot org
- Date: Thu, 12 Mar 2015 14:00:45 +0100
- Subject: Re: [PATCH 3/3] Use latest <semaphore.h> from FreeBSD for RTEMS
- Authentication-results: sourceware.org; auth=none
- References: <1425906188-22578-1-git-send-email-sebastian dot huber at embedded-brains dot de> <1425906188-22578-3-git-send-email-sebastian dot huber at embedded-brains dot de> <20150311103330 dot GU5732 at calimero dot vinschen dot de> <894132805 dot 1220473 dot 1426076231530 dot JavaMail dot zimbra at embedded-brains dot de> <20150311123538 dot GA5732 at calimero dot vinschen dot de> <20150311124518 dot GB5732 at calimero dot vinschen dot de>
On 11/03/15 13:45, Corinna Vinschen wrote:
On Mar 11 13:35, Corinna Vinschen wrote:
On Mar 11 13:17, Sebastian Huber wrote:
+#define SEM_VALUE_MAX (__INT_MAX__ * 2U + 1U)
Should the definition of SEM_VALUE_MAX be __BSD_VISIBLE? It's not a
definition required or even mentioned in POSIX.
We have a {SEM_VALUE_MAX} here:
http://pubs.opengroup.org/onlinepubs/009695399/functions/sem_open.html
Is this not a define? In FreeBSD it is not covered by __BSD_VISIBLE.
This is weird. SEM_VALUE_MAX is not mentioned in
http://pubs.opengroup.org/onlinepubs/009695399/basedefs/semaphore.h.html
Is that a bug in the specification?
SUSv4 defines SEM_VALUE_MAX to be in limits.h. That's where we
have it in Cygwin, too. There's also the definition of SEM_VALUE_MAX
for RTEMS in libc/sys/rtems/include/limits.h.
It seems defining it additionally in semaphore.h is not quite correct.
It also contradicts the value from your limits.h (32767).
Corinna
Thanks, for the thorough review. I will update the patch. This
SEM_VALUE_MAX seems to be quite ill defined. In Newlib the
libc/sys/linux/linuxthreads/semaphore.h defines it too in contrast to
glibc which defines in in limits.h. Probably nobody cares about this value.
--
Sebastian Huber, embedded brains GmbH
Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone : +49 89 189 47 41-16
Fax : +49 89 189 47 41-09
E-Mail : sebastian.huber@embedded-brains.de
PGP : Public key available on request.
Diese Nachricht ist keine geschÃftliche Mitteilung im Sinne des EHUG.