Subject: Re: problems with arpa/inet.h
To: None <current-users@NetBSD.ORG>
From: Ross Harvey <email@example.com>
Date: 06/16/1998 12:53:40
> From: Andrew Brown <firstname.lastname@example.org>
> personally...i'm always finding myself being bitten by the need for
> unistd.h for almost all the system calls i ever use (like read(),
> write(), lseek(), and close()) *except* open(), which is in an include
> file by a different name (along with all the flags that open() needs).
> and i use open() a lot more than i use fcntl(). can someone point me
> to the standards web page that justifies this? :(
In this case, the specification is from 1003.1b, to open() you must include
types, stat, and fcntl, and the open() prototype is specifically required to
be in <fcntl.h>. (See sections 2.7.3, 22.214.171.124., and also the semi-standard
"Annex C line 64".)
Feature test macros are required to disable _any_ definitions not specifically
a part of the standard, although it is true that few applications use them.
(And sometimes those that do misunderstand that the macros _disable_ things
rather than _enable_ them.)
It just might be possible to finesse the standard so that some common prototypes
are visible is uncommon places, but look at how bogus this would be: programs
compiled on NetBSD would then not get the headers elsewhere. Conforming
programs already have to do the posix includes, so we would be doing people
no favors at all by giving them automatic (but NetBSD only) prototypes.