Subject: Re: #include problem
To: Valeriy E. Ushakov <uwe@ptc.spbu.ru>
From: Klaus Klein <kleink@reziprozitaet.de>
List: port-sparc
Date: 12/29/2001 16:35:54
"Valeriy E. Ushakov" <uwe@ptc.spbu.ru> writes:

> On Sat, Dec 29, 2001 at 07:25:58 -0700, Herb Peyerl wrote:
> 
> > "Jan Senolt" <senolt@sps-jia.cz>  wrote:
> >  > I have problem with include any headers files (e.g. =
> >  > /usr/include/sys/socket.h) to my C program:
> >  > When I try compile this "program":
> >  > 
> >  > #include <sys/socket.h>
> >  > void main(){
> >  > }
> >  > 
> >  > I've got those errors:
> >  > 
> >  > In file included from test.c:1:
> >  > /usr/include/sys/socket.h:186: syntax error before `u_char'
> >  > /usr/include/sys/socket.h:214: syntax error before `u_char'
> > 
> > You have to include <sys/types.h>
> > 
> > 'grep' is your friend.
> 
> Our socket(2) says 
> 
>      #include <sys/socket.h>
> 
>      int
>      socket(int domain, int type, int protocol);
> 
> I checked Solaris and FreeBSD and they both say: 
> 
>      #include <sys/types.h>
>      #include <sys/socket.h>
> 
> We should update our man page, perhaps?

In the meantime XNS, POSIX et al. have specified <sys/socket.h> to not
require prerequisite headers, and NetBSD-current has followed in due
course.


- Klaus