Article View: comp.std.unix
Article #913Re: Is this POSIX compliant?
From: Donald Lewine
Date: Mon, 10 Jun 1991 20:49
Date: Mon, 10 Jun 1991 20:49
71 lines
3745 bytes
3745 bytes
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>
^^^^^^^^^^^^^^^^^^ 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 <stdio.h> /* sscanf() setbuf() fclose() stdin stdout
|> stderr fopen() fread() fwrite() fgetc()
|> getchar() FILE */
|> #include <stddef.h> /* EOF */
NO. EOF is defined in <stdio.h>.
<stddef.h> defines:
NULL, offsetof, ptrdiff_t, size_t, wchar_t
|> #include <stdlib.h> /* getenv() memmove() malloc() realloc()
|> free() strtol() size_t */
memmove() is in <string.h> all others are
in <stdlib.h>
|> #include <time.h> /* time() ctime() time_t */
|> #include <fcntl.h> /* O_RDONLY O_WRONLY O_APPEND O_SYNC */
O_SYNC is not a POSIX symbol
|> #include <pwd.h> /* setpwent() getpwuid() endpwent() */
setpwent() is not in POSIX.1 (admin func)
endpwent() is not in POSIX (not needed)
|> #include <sys/wait.h> /* wait() */
|> #include <sys/utsname.h> /* uname() utsname */
|> #include <sys/types.h> /* pid_t mode_t struct stat */
struct stat is in <sys/stat.h>
|> #include <sys/stat.h> /* stat() S_ISDIR() */
|> #include <signal.h> /* signal() kill() */
|> #include <string.h> /* strcpy() strncpy() strcat() strlen()
|> strspn() strcspn() strchr() strcmp()
|> strncmp() strpbrk() strstr() */
|> #include <errno.h> /* 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
Technical Details
Message-ID:
<1991Jun12.035046.16547@uunet.uu.net>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!uunet.UU.NET!sefReferences:
<4369@rwthinf.UUCP> <4369@rwthinf.UUCP>,Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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