Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 29 Dec 2002 15:18:45 +1100 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Mark Valentine <mark@thuvia.demon.co.uk>
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:  <20021229145941.G39748-100000@gamplex.bde.org>
In-Reply-To: <200212290007.gBT07YVO012379@dotar.thuvia.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 29 Dec 2002, Mark Valentine wrote:

> > From: phk@freebsd.org (Poul-Henning Kamp)
> >   Sensible people could just put iovec into sys/_types.h but there
> >   is probably some standard or other which will be violated if we
> >   did something that horrible.
>
> 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.  POSIX is now
full of mistakes like this, so almost every header _may_ include every
other header.  It's not quite that bad, but only people who know every
"may" in the standard could tell the difference.  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.

> 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).  Another mistake in POSIX is that FILE must be
declared in more places than <stdio.h>.  The other place is <wchar.h>.
Fortunately, this mistake is only required if the XSI extensions mistake
is fully implemented.  We don't implement this.  However, we implement
a nearby XSI mistake for va_list.

Bruce


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?20021229145941.G39748-100000>