Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uwm.edu!cs.utexas.edu!uunet!usenix!std-unix From: decot@hpisod2.cup.hp.com (Dave Decot) Newsgroups: comp.std.unix Subject: Re: POSIX vs SVID Message-ID: <436@usenix.ORG> Date: 16 Aug 90 00:38:14 GMT References: <11188@cs.utexas.edu> Sender: std-unix@usenix.ORG Organization: Hewlett Packard, Cupertino Lines: 42 Approved: jsq@usenix.org (Moderator, John Quarterman) X-Submissions: std-unix@uunet.uu.net From: decot@hpisod2.cup.hp.com (Dave Decot) > 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. POSIX.1-1988 also says that is required, but it says it elsewhere, in section 2.8.3: If a function is not listed below, it shall have its prototype appear in , which is presumed to be #included-ed whenever any function declared in it is used, whether or not it is mentioned in the Synopsis section for that function. > 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)? You can always include any POSIX.1 header wherever you want in a POSIX.1 conforming program (except where it would cause a syntax error, such as in the middle of a declaration or statement :-). > 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! The declaration or function prototype for setuid() must appear in , and the application must #include it. In some cases, the header might contain a faster macro version of the function. Future versions of POSIX.1 will not require the application to #include for any purpose, since any needed types for a given function will also be available from the header which declares that function. Dave Decot Volume-Number: Volume 21, Number 38