Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!uunet.UU.NET!sef From: lewine@cheshirecat.webo.dg.com (Donald Lewine) Newsgroups: comp.std.unix Subject: Re: Is this POSIX compliant? Message-ID: <1991Jun12.035046.16547@uunet.uu.net> Date: 10 Jun 91 20:49:47 GMT References: <4369@rwthinf.UUCP> <4369@rwthinf.UUCP>, Sender: usenet@uunet.uu.net (UseNet News) Reply-To: lewine@cheshirecat.webo.dg.com Organization: Data General Corporation Lines: 71 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 Submitted-by: lewine@cheshirecat.webo.dg.com (Donald Lewine) In article <4369@rwthinf.UUCP>, berg@physik.tu-muenchen.de (Stephen R. van den Berg) writes: |> 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). To solve this problem at less than half the price of the IEEE standard, and get much more information, see below. . . |> #include ^^^^^^^^^^^^^^^^^^ unistd.h contains the prototypes for the functions you list and should be included in an ANSI C system. |> /* open() read() write() close() dup() pipe() |> fork() getpid() execve() execvp() */ |> #include /* sscanf() setbuf() fclose() stdin stdout |> stderr fopen() fread() fwrite() fgetc() |> getchar() FILE */ |> #include /* EOF */ NO. EOF is defined in . defines: NULL, offsetof, ptrdiff_t, size_t, wchar_t |> #include /* getenv() memmove() malloc() realloc() |> free() strtol() size_t */ memmove() is in all others are in |> #include /* time() ctime() time_t */ |> #include /* O_RDONLY O_WRONLY O_APPEND O_SYNC */ O_SYNC is not a POSIX symbol |> #include /* setpwent() getpwuid() endpwent() */ setpwent() is not in POSIX.1 (admin func) endpwent() is not in POSIX (not needed) |> #include /* wait() */ |> #include /* uname() utsname */ |> #include /* pid_t mode_t struct stat */ struct stat is in |> #include /* stat() S_ISDIR() */ |> #include /* signal() kill() */ |> #include /* strcpy() strncpy() strcat() strlen() |> strspn() strcspn() strchr() strcmp() |> strncmp() strpbrk() strstr() */ |> #include /* EINTR EEXIST EMFILE ENFILE */ The header files contain symbols in addition to the ones you list. A complete listing of the POSIX headers is in Appendix A of the POSIX Programmer's Guide available for $34.95 from: O'Reilly and Associates, Inc. 632 Petaluma Ave Sebastopol, CA 95472 (800) 338-6887 uunet!ora!nuts nuts@ora.uu.net 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. -------------------------------------------------------------------- Donald A. Lewine (508) 870-9008 Voice Data General Corporation (508) 366-0750 FAX 4400 Computer Drive. MS D112A Westboro, MA 01580 U.S.A. uucp: uunet!dg!lewine Internet: lewine@cheshirecat.webo.dg.com Volume-Number: Volume 23, Number 100