[Bug 224300] sys/sem.h improperly declares union semun

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Tue Dec 12 23:37:59 UTC 2017


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=224300

            Bug ID: 224300
           Summary: sys/sem.h improperly declares union semun
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: kern
          Assignee: freebsd-bugs at FreeBSD.org
          Reporter: brooks at FreeBSD.org

sys/sem.h declares union semun imporpertly.  According to the POSIX manpage, it
should be declared by the application if required:

> The semctl() function provides a variety of semaphore control operations as
> specified by cmd. The fourth argument is optional and depends upon the
> operation requested. If required, it is of type union semun, which the
> application shall explicitly declare:
> 
> union semun {
>     int val;
>     struct semid_ds *buf;
>     unsigned short  *array;
> } arg;

union semun is used in the kernel so the declaration should be moved under an
#ifdef _KERNEL and an exprun should be performed.  It looks like configure
scripts commonly handle this case so it may change code, but shouldn't break
much.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list