On Sat, Nov 20, 2010 at 11:54 AM, Ted Unangst <ted.unan...@gmail.com> wrote:
> On Sat, Nov 20, 2010 at 9:18 AM, Mark Kettenis <mark.kette...@xs4all.nl>
wrote:
>>>  openbsd is apparently among the last operating systems to require
>>>  sys/types.h before sys/socket.h.  posix doesn't require this and it runs
>>>  contrary to current recommendations i think, so it's just one more weird
>>>  thing to deal with when trying to get something to compile.
>>>
>>>  i haven't really tested this, i'm just throwing it out there.
>>>
>>
>> Sorry, but blindly including <sys/types.h> isn't allowed by POSIX.
>
> Requiring everyone to include sys/types.h before socket.h isn't
> allowed by posix either.  This way, at least the code compiles without
> changes.
>
> our socket.h header is broken.  this makes it better.

By, the way, there's this comment in types.h:

 * XPG4.2 states that inclusion of <netinet/in.h> must pull these
 * in and that inclusion of <sys/socket.h> must pull in sa_family_t.
 * We put these here because there are other headers that require
 * these types and <sys/socket.h> and <netinet/in.h> will indirectly
 * include <sys/types.h>.

So somebody already thinks socket.h includes types.h.

Reply via email to