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