> > If i understand correctly, headers using types from <sys/types.h>
> > ought to include <sys/types.h>
> >  - unconditionally, if they are POSIX headers and the use of the
> >    type is mandated by POSIX
> >  - protected by __BSD_VISIBLE or the appropriate feature macro
> >    like __XPG_VISIBLE, if they are POSIX headers and if the use
> >    is not mandated by POSIX, but by a lesser standard
> >  - protected by __BSD_VISIBLE only, if they are POSIX headers and
> >    if the use is not mandated by a standard
> >  - unconditionally, if they are not POSIX headers
> 
> You have the latter case wrong.  We tend to not include header files
> in other header files, unless mandated by some standard.
> 
> So I think the man pages should be amended to #include <sys/types.h>.

Mark is correct.  It is simply a documentation error.

If we went the other way around, people would be able to include less
files; indeed, almost be careless about what they include.  But this
would not increase portability in any way.  And 'make build' would
probably, if it was taken the nth degree, take twice as long.
Therefore there is no benefit for the crazy rule you suggest which I
am going to call "pull in the world".

To be even more silly, there is another way to "pull in the world".  We
simply put all of the includes into "sys/types.h" with protection, and
make all the other include files a hard link.  Ha ha.

Reply via email to