Path: 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 Organization: Data General Corporation, Research Triangle Park, NC Lines: 48 Approved: jsq@usenix.org (Moderator, John Quarterman) X-Submissions: std-unix@uunet.uu.net From: Bob Goudreau 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 be included. > The SVID requires that both and be included. > > Question: Is there anything wrong with this? If I write a strictly > conforming application, can I include 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 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 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 , 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