home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / std_unix / volume.23 / text0096.txt < prev    next >
Encoding:
Text File  |  1991-06-15  |  2.9 KB  |  73 lines

  1. Submitted-by: lewine@cheshirecat.webo.dg.com (Donald Lewine)
  2.  
  3. In article <4369@rwthinf.UUCP>, berg@physik.tu-muenchen.de (Stephen R. van den Berg) writes:
  4. |> Could someone knowledgable please tell me if the following include files,
  5. |> the mentioned identifiers and the include files they are 'allocated' to are
  6. |> all conform the POSIX standard?  (I dont't have any POSIX literature,
  7. |> so all the data I present here are educated guesses).
  8.  
  9. To solve this problem at less than half the price of the IEEE 
  10. standard, and get much more information, see below. . .
  11.  
  12. |> 
  13.   #include <unistd.h> 
  14.   ^^^^^^^^^^^^^^^^^^  unistd.h contains the prototypes for the
  15.                       functions you list and should be included in
  16.                       an ANSI C system.
  17. |>                 /* open() read() write() close() dup() pipe()
  18. |>                    fork() getpid() execve() execvp() */
  19. |> #include <stdio.h>        /* sscanf() setbuf() fclose() stdin stdout
  20. |>                    stderr fopen() fread() fwrite() fgetc()
  21. |>                    getchar() FILE */
  22. |> #include <stddef.h>        /* EOF */
  23.                    NO.  EOF is defined in <stdio.h>.  
  24.                    <stddef.h> defines:
  25.                    NULL, offsetof, ptrdiff_t, size_t, wchar_t
  26. |> #include <stdlib.h>        /* getenv() memmove() malloc() realloc()
  27. |>                    free() strtol() size_t */
  28.                    memmove() is in <string.h>  all others are 
  29.                    in <stdlib.h>
  30. |> #include <time.h>        /* time() ctime() time_t */
  31. |> #include <fcntl.h>        /* O_RDONLY O_WRONLY O_APPEND O_SYNC */
  32.                     O_SYNC is not a POSIX symbol
  33. |> #include <pwd.h>        /* setpwent() getpwuid() endpwent() */
  34.                      setpwent() is not in POSIX.1 (admin func)
  35.                      endpwent() is not in POSIX (not needed)
  36. |> #include <sys/wait.h>        /* wait() */
  37. |> #include <sys/utsname.h>    /* uname() utsname */
  38. |> #include <sys/types.h>        /* pid_t mode_t struct stat */
  39.                      struct stat is in <sys/stat.h>
  40. |> #include <sys/stat.h>        /* stat() S_ISDIR() */
  41. |> #include <signal.h>        /* signal() kill() */
  42. |> #include <string.h>        /* strcpy() strncpy() strcat() strlen()
  43. |>                    strspn() strcspn() strchr() strcmp()
  44. |>                    strncmp() strpbrk() strstr() */
  45. |> #include <errno.h>        /* EINTR EEXIST EMFILE ENFILE */
  46.  
  47. The header files contain symbols in addition to the ones you list.
  48. A complete listing of the POSIX headers is in Appendix A of the 
  49. POSIX Programmer's Guide available for $34.95 from:
  50.  
  51.     O'Reilly and Associates, Inc.
  52.     632 Petaluma Ave
  53.     Sebastopol, CA 95472
  54.     (800) 338-6887
  55.     uunet!ora!nuts
  56.     nuts@ora.uu.net
  57.  
  58. In my not so humble opinion, the POSIX Programmer's Guide is
  59. required reading for anyone who wants to write programs that
  60. work on all POSIX systems.
  61.  
  62. --------------------------------------------------------------------
  63. Donald A. Lewine                (508) 870-9008 Voice
  64. Data General Corporation        (508) 366-0750 FAX
  65. 4400 Computer Drive. MS D112A
  66. Westboro, MA 01580  U.S.A.
  67.  
  68. uucp: uunet!dg!lewine   Internet: lewine@cheshirecat.webo.dg.com
  69.  
  70.  
  71. Volume-Number: Volume 23, Number 100
  72.  
  73.