Date: Sun, 29 Dec 2002 05:19:31 GMT From: Mark Valentine <mark@thuvia.demon.co.uk> To: Bruce Evans <bde@zeta.org.au> Cc: Poul-Henning Kamp <phk@FreeBSD.org>, <cvs-committers@FreeBSD.org>, <cvs-all@FreeBSD.org> Subject: Re: cvs commit: src/sys/sys _iovec.h socket.h uio.h Message-ID: <200212290519.gBT5JVeN019638@dotar.thuvia.org> In-Reply-To: <20021229145941.G39748-100000@gamplex.bde.org>
next in thread | previous in thread | raw e-mail | index | archive | help
> From: Bruce Evans <bde@zeta.org.au> > Date: Sun 29 Dec, 2002 > Subject: Re: cvs commit: src/sys/sys _iovec.h socket.h uio.h > On Sun, 29 Dec 2002, Mark Valentine wrote: > > Actually, the IEEE Std 1003.1-2001 spec. for <sys/socket.h> states: > > > > "Inclusion of <sys/socket.h> may also make visible all symbols > > from <sys/uio.h>." > > > > So, it seems it would be sufficient to have a single definition of > > struct iovec in <sys/uio.h>. > > Only low quality implementations would use this mistake. Ah. I read it as an implementation hint, but it is a bit inconsistent with what I'm used to with POSIX standards. > This is simpler for > implementations but more difficult for applications -- applications > have to be concerned about namespace pollution in every standard header > but can't depend on it. Indeed, an application can't depend on seeing a prototype for writev() due to including <sys/socket.h>. However, given that the standard says that it _may_, in this case I still don't see why such an implementation would be so poor, other than forcing the compiler to parse the pollution of readv()/ writev() declarations for applications which include <sys/socket.h> (which I guess is reason enough to some). > > It would seem to also work having it in <sys/types.h>, since both > > interfaces from <sys/uio.h> and some from <sys/socket.h> use ssize_t > > and/or size_t, but this should be considered accidental. > > It would work as well as declaring FILE in <sys/types.h> and including > that in <stdio.h> (not). Urk, I wasn't advocating including <sys/types.h> in either <sys/socket.h> or <sys/uio.h>, simply pointing out that an application using either of the last two will also be including the first. Nor was I even implying that this would be anything other than a poor implementation. Cheers, Mark. -- Mark Valentine, Thuvia Labs <mark@thuvia.co.uk> <http://www.thuvia.co.uk> "Tigers will do ANYTHING for a tuna fish sandwich." Mark Valentine uses "We're kind of stupid that way." *munch* *munch* and endorses FreeBSD -- <http://www.calvinandhobbes.com> <http://www.freebsd.org> To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200212290519.gBT5JVeN019638>