Re: getenv, putenv



When I try to invoke same environment variable using another thread
within same process using getenv, I am not able to access the value of
env variable.

Can Anyone please let me know, what could be the probable reason for
this problem.

AFAIR there was some spec that said that you can't use getenv to
retrieve variables set by the same process. setenv is just there to
pass
variables to child processes.

I also run into this a few years ago and it has nothing to do with
multithreading.
If you can use setenv/getenv in the same process it is an
implementation
detail but trust it - and by the way why do you want to do it anyway.
.



Relevant Pages

  • Re: Python/C and PYTHONPATH
    ... void fdump_env ... call setenv to manually set a python-path. ... you can use that in combo with getenv to append to an ...
    (comp.lang.python)
  • Re: Fix for memory leak in setenv/unsetenv
    ... setenv() and unsetenv. ... With the memory leak fixed this will use free'd memory. ... the first library had a cached pointer to the value of. ... The return value from getenv() may point to static data which may be ...
    (freebsd-current)
  • Re: HEADS DOWN
    ... On Thu, 3 May 2007, Andrey Chernov wrote: ... setenv() and unsetenv() perform the same check on ... should not getenv() do the same? ...
    (freebsd-arch)
  • Re: HEADS DOWN
    ... setenv() and unsetenv() perform the same check on the ... should not getenv() do the same? ... a bad name instead of allowing a core dump? ...
    (freebsd-arch)