Is this POSIX compliant?
Donald Lewine
lewine at cheshirecat.webo.dg.com
Tue Jun 11 06:49:47 AEST 1991
Submitted-by: lewine at cheshirecat.webo.dg.com (Donald Lewine)
In article <4369 at rwthinf.UUCP>, berg at 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 at 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 at cheshirecat.webo.dg.com
Volume-Number: Volume 23, Number 100
More information about the Comp.std.unix
mailing list