[PATCH 3/3] Use latest <semaphore.h> from FreeBSD for RTEMS

Sebastian Huber sebastian.huber@embedded-brains.de
Thu Mar 12 13:17:00 GMT 2015



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.



More information about the Newlib mailing list