> Date: Sun, 5 Jul 2009 21:58:35 +0200
> From: Ingo Schwarze <schwa...@usta.de>
> 
> The header <login_cap.h> uses quad_t and uid_t.
> The type quad_t is a non-POSIX type defined in <sys/types.h>.
> The type uid_t is required by POSIX in <sys/types.h>.
> 
> The header <bsd_auth.h> uses size_t.
> The type size_t is required by POSIX in <sys/types.h>.
> 
> > no one has replied to this yet, i think. so, the man page is right or
> > wrong? any takers?
> 
> I guess the manual is fine, but i'm not sure these two header files
> are correct.  Lots of other header files include <sys/types.h>,
> both some traditional BSD headers like <db.h> and some POSIX headers
> like <fcntl.h>.
> 
> Probably, this went unnoticed because most programs including
> the headers <login_cap.h> and <bsd_auth.h> also include some
> of the other headers including <sys/types.h>, like <pwd.h>,
> <stdio.h>, <stdlib.h> and <unistd.h>...
> 
> 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

Reply via email to