home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / c / 13156 < prev    next >
Encoding:
Text File  |  1992-09-03  |  1.6 KB  |  36 lines

  1. Newsgroups: comp.lang.c
  2. Path: sparky!uunet!haven.umd.edu!darwin.sura.net!Sirius.dfn.de!zrz.tu-berlin.de!cs.tu-berlin.de!jutta
  3. From: jutta@opal.cs.tu-berlin.de (Jutta Degener)
  4. Subject: putenv() (was: Re: main())
  5. Message-ID: <1992Sep3.125944.21485@cs.tu-berlin.de>
  6. Sender: news@cs.tu-berlin.de
  7. Organization: Techn. University of Berlin, Germany
  8. References: <715416182@Isis.MsState.Edu> <6700001@tisdec.tis.tandy.com> <chupchup.715509038@piggy>
  9. Date: Thu, 3 Sep 1992 12:59:44 GMT
  10. Lines: 24
  11.  
  12. chupchup@ferkel.ucsb.edu (Robert Earl) writes:
  13. > [char ** envp is] very rarely used in UNIX, particularly,
  14. > because the startup routine stuffs envp in a global variable called
  15. > "environ", probably so main() doesn't have to do it all the time.
  16. > But "environ" doesn't exist in ANSI only getenv() and putenv(),
  17. > and this is comp.lang.c.  :-)
  18.  
  19. Note that the only place where putenv() exists "in ANSI" is in
  20. the rationale (which is not part of the Standard) in the sentence:
  21.  
  22.   "A corresponding _putenv_ function was omitted from the Standard,
  23.    since its utility outside a multi-process environment is questionable, 
  24.    and since its definition is properly the domain of the operating
  25.    system standard."
  26.  
  27. A colleague of mine just heaved his new "Advanced Programming in
  28. the UNIX Environment" by W. R. Stevens from the stack of books
  29. on his desk and suggested I mention the fact that XPG3 includes
  30. putenv() (and a lot of other things like clearenv() and unsetenv()),
  31. and that it was considered as an amendment to POSIX.1, and is
  32. implemented both in SVR4 and newer versions of 4.3 BSD, but, this
  33. being comp.lang.c, I politely declined.  (Good book.)
  34.  
  35. --Jutta
  36.