home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 January
/
usenetsourcesnewsgroupsinfomagicjanuary1994.iso
/
sources
/
std_unix
/
v21
/
035
< prev
next >
Wrap
Internet Message Format
|
1990-12-05
|
3KB
From uucp@tic.com Thu Aug 16 09:40:45 1990
Received: from cs.utexas.edu by uunet.uu.net (5.61/1.14) with SMTP
id AA26599; Thu, 16 Aug 90 09:40:45 -0400
Posted-Date: 15 Aug 90 20:30:35 GMT
Received: by cs.utexas.edu (5.64/1.70)
id AA09843; Thu, 16 Aug 90 08:40:41 -0500
Received: by longway.tic.com (4.22/tic.1.2)
id AA05179; Thu, 16 Aug 90 08:34:48 cdt
From: Bob Goudreau <goudreau@larrybud.rtp.dg.com>
Newsgroups: comp.std.unix
Subject: Re: POSIX vs SVID
Message-Id: <433@usenix.ORG>
References: <11188@cs.utexas.edu>
Sender: std-unix@usenix.ORG
Reply-To: Bob Goudreau <goudreau@larrybud.rtp.dg.com>
Organization: Data General Corporation, Research Triangle Park, NC
X-Submissions: std-unix@uunet.uu.net
Date: 15 Aug 90 20:30:35 GMT
Apparently-To: std-unix-archive@uunet.uu.net
From: Bob Goudreau <goudreau@larrybud.rtp.dg.com>
In article <11188@cs.utexas.edu>, Don_Lewine@dgc.ceo.dg.com writes:
>
> I have been comparing SVID Issue 3 (for V.4) to IEEE Std 1003.1-1988.
> I noticed that the SVID specifies header files in the synopsis for
> various functions that are not required for POSIX. For example,
> POSIX says that setuid() requires that <sys/types.h> be included.
> The SVID requires that both <sys/types.h> and <unistd.h> be included.
>
> Question: Is there anything wrong with this? If I write a strictly
> conforming application, can I include <unistd.h> for SVID
> compatibility even if POSIX does not require it? Is there any
> problem with including "extra" header files (other than the obvious
> restrictions on the namespace)?
>
> BTW, looking at the SVR4 code there is nothing in <unistd.h> that
> would require it to be included for setuid(). There do not seem to
> be any symbols in the header file that are prohibited. However, this
> is a standards questions and reading the .h files is cheating!
At least for the case of implementations claiming to conform to ANSI C,
POSIX.1-1988 does indeed require that <unistd.h> must contain a
prototype for setuid(). Here's the relevant text, from section 2.8.3:
Implementations claiming C Standard Language-Dependent Support
shall declare function prototypes for all functions.
Implementations claiming Common Usage C Language-Dependent
Support shall declare the result type for all functions not
returning a "plain" _int_.
These function prototypes (if required) shall appear in the
headers listed below. If a function is not listed below, it
shall have its prototype appear in <unistd.h>, which is
presumed to be #include-ed whenever any function declared in it
is used, whether or not it is mentioned in the Synopsis
section for that function.
------------------------------------------------------------------------
Bob Goudreau +1 919 248 6231
Data General Corporation
62 Alexander Drive goudreau@dg-rtp.dg.com
Research Triangle Park, NC 27709 ...!mcnc!rti!xyzzy!goudreau
USA
Volume-Number: Volume 21, Number 35