<sys/select.h> depends on <sys/types.h>...?

Chuck Swiger cswiger at mac.com
Tue Jan 18 20:32:05 PST 2005


Michael Nottebrock wrote:
> Chuck Swiger wrote:
[ ... ]
>> OK, although note that MacOS X compiles foo.cxx without changes-- 
>> sys/select.h will pull in what it needs to work on that platform:
> 
> IIRC, FreeBSD 5.x doesn't need the extra <sys/types.h> include either. 
> AFAIK, it's not so a much wrong-or-right issue (SUSv2 or similar 
> standards don't require sys/select.h to setup the types it needs), but 
> just a change of conventions (not having to include sys/types.h to make 
> sys/select.h work is certainly convenient).

OK, thanks for the additional thoughts.

I'm happy to see system header files move in a direction that facilitates 
use-- ie, they know what they depend on and ensure that what they need gets 
pulled in.  After all, if people are going to spend the time & effort to make 
system header files...erm, idempotent?, then one might as well take advantage 
of that and of any compiler support available (precompiled headers).

> If you go back a few linux kernel/solaris/macosx releases, you'd 
> probably find the extra include requirement there, too.

Sure.  Only, if an earlier version of Linux 2.2 or OS X needed sys/types.h to 
use sys/select.h, then wouldn't the BZFlag sources know to use it by now...?

:-)

-- 
-Chuck



More information about the freebsd-ports mailing list