Subject: Re: getnameinfo type incompatibility
To: None <tech-net@netbsd.org>
From: Christos Zoulas <christos@zoulas.com>
List: tech-net
Date: 05/21/2000 02:56:02
In article <23266.958872914@coconut.itojun.org>,  <itojun@iijlab.net> wrote:
> 
> >> >> 	hmm, it looks fine...  i'll try this locally and then will
> >> >> 	bring it to the repository.  btw, was it ansi that defines socklen_t?
> >> >> 	or was it X/Open thing?
> >> >Great!  As for socklen_t, it was first introduced in XSH5.
> >> >(IPC would be really out of the scope of ANSI.)
> >> 	do you think it okay to put socklen_t into <sys/ansi.h>?
> >Oh, now I can see your point.  I proposed <sys/ansi.h> for __socklen_t
> >because in a way it's similar to <machine/ansi.h>; the whole point of the
> >exercise being the workaround for `multiple' typedefs, which was permitted
> >in K&R IIRC.
> 
> 	outline:
> 	include/netdb.h needs socklen_t declaration.
> 	simply including sys/types.h and sys/socket.h would have too many
> 	sideeffects (for example, include file requirement in gethostbyname(3)
> 	manpage gets changed).
> 
> 	Klaus suggested the following patch.  it worked for me ("make build"
> 	goes just fine).  it adds sys/ansi.h (name suggested by Klaus).
> 	bsdi4 uses sys/sockettypes.h for similar usage.  not sure which
> 	filename sounds better - my vote goes to sys/sockettypes.h since
> 	socklen_t is outside ANSI.   any opinions, suggestions?
> 

There is a standard way that we do this in <machine/ansi.h> for all
other typedefs, why invent a new one and a new file?

christos