Putenv() & Getenv() Bug ?

Doug McDonald mcdonald at aries.scs.uiuc.edu
Sun Feb 17 12:43:54 AEST 1991


In article <448 at bria>  writes:
>In an article, aries.scs.uiuc.edu!mcdonald (Doug McDonald) writes:
>
>[ in response to a question on putenv() and getenv() ]
>
>>This is a system-specific question. It has nothing to do with C or Fortran per 
>>se: It should be posted in an SCO Unix specific newsgroup, or at least
>>a Unix specific newsgroup. Not a general one like comp.lang.c.
>
>I don't believe that this is as system-specific as you would would like to
>believe.  I have not yet encountered a C library that didn't include these
>two _subroutines_ regardless of operating system.  Note that they are _not_
>operating system calls, but rather simple routines that search and insert from
>a list.  If your library doesn't have 'em, I would consider it broken.
>
>-- 
>Michael Stefanik, MGI Inc., Los Angeles| Opinions stated are not even my own.



Yep, the system has to have getenv or its broken (or its a free-standing
implementation :-). But apparently NOT putenv. In fact, as best as I can tell,
"putenv" is on the list of functions a conforming C compiler CANNOT have!!


But anything they DO is "implememtation dependent", and should be discussed
in the appropriate implementation-dependent place. The only possible
portable thing "getenv" can do is return NULL.

Doug McDonald



More information about the Comp.lang.c mailing list