home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / std_unix / volume.24 / text0005.txt < prev    next >
Encoding:
Text File  |  1991-09-03  |  2.2 KB  |  61 lines

  1. Submitted-by: gwc@root.co.uk (Geoff Clare)
  2.  
  3. berg@physik.tu-muenchen.de (Stephen R. van den Berg) wrote:
  4.  
  5. ] Could someone knowledgable please tell me if the following include files,
  6. ] the mentioned identifiers and the include files they are 'allocated' to are
  7. ] all conform the POSIX standard?  (I dont't have any POSIX literature,
  8. ] so all the data I present here are educated guesses).
  9.  
  10. I emailed my answer to Stephen like a good net.user, but now I see
  11. that an incorrect answer has been posted to the newsgroup, so I feel
  12. obliged to waste more bandwidth by correcting it.
  13.  
  14. lewine@cheshirecat.webo.dg.com (Donald Lewine) writes:
  15.  
  16. ]|> 
  17. ]  #include <unistd.h> 
  18. ]  ^^^^^^^^^^^^^^^^^^  unistd.h contains the prototypes for the
  19. ]                      functions you list and should be included in
  20. ]                      an ANSI C system.
  21.  
  22. Except that open() is in <fcntl.h>, not <unistd.h>.  Also the comments
  23. regarding prototypes and ANSI C are misleading.  The original poster asked
  24. about "POSIX", he didn't specify "POSIX with ANSI C", so I assume he wants
  25. answers which apply equally well to POSIX with either common C or ANSI C.
  26.  
  27. ]|> #include <stddef.h>        /* EOF */
  28. ]                   NO.  EOF is defined in <stdio.h>.  
  29. ]                   <stddef.h> defines:
  30. ]                   NULL, offsetof, ptrdiff_t, size_t, wchar_t
  31.  
  32. <stddef.h> is not required by POSIX.1.
  33.  
  34. ]|> #include <stdlib.h>        /* getenv() memmove() malloc() realloc()
  35. ]|>                    free() strtol() size_t */
  36. ]                   memmove() is in <string.h>  all others are 
  37. ]                   in <stdlib.h>
  38.  
  39. memmove() and strtol() are not required by POSIX.1.
  40.  
  41. ]|> #include <signal.h>        /* signal() kill() */
  42.  
  43. signal() is not required by POSIX.1.
  44.  
  45. ]A complete listing of the POSIX headers is in Appendix A of the 
  46. ]POSIX Programmer's Guide available for $34.95 from:
  47. (address deleted)
  48. ]In my not so humble opinion, the POSIX Programmer's Guide is
  49. ]required reading for anyone who wants to write programs that
  50. ]work on all POSIX systems.
  51.  
  52. I hope it wasn't the source of the errors above.
  53.  
  54. -- 
  55. Geoff Clare <gwc@root.co.uk>  (Dumb American mailers: ...!uunet!root.co.uk!gwc)
  56. UniSoft Limited, London, England.   Tel: +44 71 729 3773   Fax: +44 71 729 3273
  57.  
  58.  
  59. Volume-Number: Volume 24, Number 7
  60.  
  61.