Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Dec 2017 23:37:59 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-bugs@FreeBSD.org
Subject:   [Bug 224300] sys/sem.h improperly declares union semun
Message-ID:  <bug-224300-8@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D224300

            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@FreeBSD.org
          Reporter: brooks@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:
>=20
> 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.

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-224300-8>