Article View: comp.std.unix
Article #924Re: Is this POSIX compliant?
From: Geoff Clare
Date: Fri, 14 Jun 1991 17:53
Date: Fri, 14 Jun 1991 17:53
59 lines
2950 bytes
2950 bytes
Submitted-by: gwc@root.co.uk (Geoff Clare) berg@physik.tu-muenchen.de (Stephen R. van den Berg) wrote: ] Could someone knowledgable please tell me if the following include files, ] the mentioned identifiers and the include files they are 'allocated' to are ] all conform the POSIX standard? (I dont't have any POSIX literature, ] so all the data I present here are educated guesses). I emailed my answer to Stephen like a good net.user, but now I see that an incorrect answer has been posted to the newsgroup, so I feel obliged to waste more bandwidth by correcting it. lewine@cheshirecat.webo.dg.com (Donald Lewine) writes: ]|> ] #include <unistd.h> ] ^^^^^^^^^^^^^^^^^^ unistd.h contains the prototypes for the ] functions you list and should be included in ] an ANSI C system. Except that open() is in <fcntl.h>, not <unistd.h>. Also the comments regarding prototypes and ANSI C are misleading. The original poster asked about "POSIX", he didn't specify "POSIX with ANSI C", so I assume he wants answers which apply equally well to POSIX with either common C or ANSI C. ]|> #include <stddef.h> /* EOF */ ] NO. EOF is defined in <stdio.h>. ] <stddef.h> defines: ] NULL, offsetof, ptrdiff_t, size_t, wchar_t <stddef.h> is not required by POSIX.1. ]|> #include <stdlib.h> /* getenv() memmove() malloc() realloc() ]|> free() strtol() size_t */ ] memmove() is in <string.h> all others are ] in <stdlib.h> memmove() and strtol() are not required by POSIX.1. ]|> #include <signal.h> /* signal() kill() */ signal() is not required by POSIX.1. ]A complete listing of the POSIX headers is in Appendix A of the ]POSIX Programmer's Guide available for $34.95 from: (address deleted) ]In my not so humble opinion, the POSIX Programmer's Guide is ]required reading for anyone who wants to write programs that ]work on all POSIX systems. I hope it wasn't the source of the errors above. -- Geoff Clare <gwc@root.co.uk> (Dumb American mailers: ...!uunet!root.co.uk!gwc) UniSoft Limited, London, England. Tel: +44 71 729 3773 Fax: +44 71 729 3273 Volume-Number: Volume 24, Number 7
Technical Details
Message-ID:
<1991Jun15.180507.6722@uunet.uu.net>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!uunet!uunet.UU.NET!sefReferences:
<4369@rwthinf.UUCP> <4369@rwthinf.UUCP>, <1991Jun12.035046.16547@uunet.uu.net>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!uunet!uunet.UU.NET!sef From: gwc@root.co.uk (Geoff Clare) Newsgroups: comp.std.unix Subject: Re: Is this POSIX compliant? Message-ID: <1991Jun15.180507.6722@uunet.uu.net> Date: 14 Jun 91 17:53:02 GMT References: <4369@rwthinf.UUCP> <4369@rwthinf.UUCP>, <1991Jun12.035046.16547@uunet.uu.net> Sender: usenet@uunet.uu.net (UseNet News) Organization: UniSoft Ltd., London, England Lines: 59 Approved: sef@uunet.uu.net (Moderator, Sean Eric Fagan - comp.std.unix) Originator: sef@uunet.UU.NET Nntp-Posting-Host: uunet.uu.net X-Submissions: std-unix@uunet.uu.net