🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.unix
Article #439

Re: POSIX vs SVID

#439
From: Bob Goudreau
Date: Wed, 15 Aug 1990 20:30
48 lines
2759 bytes
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
Technical Details
Message-ID: <433@usenix.ORG>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!ucbvax!usenix!std-unix
References: <11188@cs.utexas.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!ucbvax!usenix!std-unix
From: goudreau@larrybud.rtp.dg.com (Bob Goudreau)
Newsgroups: comp.std.unix
Subject: Re: POSIX vs SVID
Message-ID: <433@usenix.ORG>
Date: 15 Aug 90 20:30:35 GMT
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
Lines: 48
Approved: jsq@usenix.org (Moderator, John Quarterman)
X-Submissions: std-unix@uunet.uu.net