POSIX 1003.1 and <sys/types.h>
Chuck Karish
karish at forel.stanford.edu
Mon Dec 18 08:06:27 AEST 1989
From: karish at forel.stanford.edu (Chuck Karish)
In article <479 at longway.TIC.COM> uunet!cbnewsd.ATT.COM!jrstu
(james.stuhlmacher,ih,) wrote:
>From: jrstu at cbnewsd.ATT.COM (james.stuhlmacher)
>
>I was told by someone that the POSIX standard does not allow
>including <sys/type.h> in any of the other include files such as
><grp.h>. Is this true? I could not find this anywhere in the book.
>If it is true, why is this the case?
Is this necessary? A portable application that uses <grp.h> had better
#include <sys/types.h> itself anyway, so it will have type gid_t
available on an implementation that does not use the nested
#includes.
There's no specific prohibition in the standard. However, it's a
non-trivial task to implement the headers in such a way that this is
safe. The implementation must not surprise the programmer by
providing an unexpected typedef or function prototype that could
legally be coded directly into a program.
Chuck Karish karish at mindcraft.com
(415) 323-9000 karish at forel.stanford.edu
Volume-Number: Volume 17, Number 107
More information about the Comp.std.unix
mailing list