This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Fix argument passing in sysvipc/test-sysvsem
On Sat, Dec 31, 2016 at 1:07 AM, Florian Weimer <fweimer@redhat.com> wrote:
> On 12/30/2016 09:43 PM, Tulio Magno Quites Machado Filho wrote:
>>
>> +/* Confirm if sys/sem.h defines semun. */
>> +#ifdef _SEM_SEMUN_UNDEFINED
>> +union semun
>> +{
>> + int val;
>> + struct semid_ds *buf;
>> + unsigned short int *array;
>> + struct seminfo *__buf;
>> +};
>> +#endif
>
>
> Sorry, I don't understand the comment. Why is this definition not provided
> by the installed headers if IPC_STAT needs it?
sys/sem.h is required *not* to declare union semun; applications are
required to declare it themselves. See
http://pubs.opengroup.org/onlinepubs/9699919799/functions/semctl.html.
Yes, this is ridiculous. I can only guess that it was omitted by
mistake from the original incarnation of SysV semaphores, so
applications started declaring it themselves, and then POSIX was over
a barrel since redundant complete aggregate definitions aren't
allowed.
zw