Date: Wed, 18 Oct 2006 00:10:25 GMT From: Bruce Evans <bde@zeta.org.au> To: freebsd-bugs@FreeBSD.org Subject: Re: kern/104436: [PATCH] sys/sem.h should include sys/types.h Message-ID: <200610180010.k9I0APjD031723@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/104436; it has been noted by GNATS. From: Bruce Evans <bde@zeta.org.au> To: John Baldwin <jhb@FreeBSD.org> Cc: Cheng-Lung Sung <clsung@FreeBSD.org>, FreeBSD-gnats-submit@FreeBSD.org Subject: Re: kern/104436: [PATCH] sys/sem.h should include sys/types.h Date: Wed, 18 Oct 2006 10:09:04 +1000 (EST) On Tue, 17 Oct 2006, John Baldwin wrote: > How's this, it removes extra includes of cdefs.h and _types.h (ipc.h > already includes them), moves the typedefs earlier and includes them > in the _KERNEL case (consistent with ipc.h) and fixes the whitespace > in the typedefs. OK. POSIX actually requires the namespace pollution with everything in sys/ipc.h, so the include of this can't be cleaned up and we may as well depend on its internals. I did a quick review of symbols in sys/sem.h: - POSIX seems to overspecify the representation: "A semaphore shall be respresented by an anonymous struct containing the following members:" [semval, sempid, semncnt, semzcnt]". FreeBSD doesn't declare any of these struct members. - FreeBSD declares several things that aren't required by POSIX and uses bad names for most of these. The worst ones are the struct member names `val', `buf' and `array'. POSIX cannot reserve these, and sem.h mostly uses a `sem' prefix to avoid such pollution. These seem to be implementation details that don't belong in the header anyway. I didn't check the symbols imported from sys/ipc.h. Both of these headers are XSI extensions, so they don't need many visibility ifdefs internally. Bruce
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200610180010.k9I0APjD031723>