I am running a multithreaded application in which I am trying to set
an environment variable using putenv. The string I am using as
argument to putenv was created as
char *str=strdup(<local var>);
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.
Re: getenv, putenv ...Bhawna wrote: ... an environment variable using putenv.... The string I am using as ... (comp.os.linux.development.apps)
Re: putenv() error returns? ...Henry Townsend wrote: ...putenv() that 'the argument should point to a string of the form "name=value"', but in looking at the ERRORS section the only defined error is ENOMEM "Insufficient memory was available". ... Of course I could try this on my platform (Solaris) and see what happens. ... (comp.unix.programmer)
Re: getenv, putenv ... an environment variable using putenv.... The string needs to be alive for as it is still ... and the reservation only applies to identifiers with file ... so an identifier with block scope can safely be called 'str'. ... (comp.os.linux.development.apps)
Re: getenv, putenv ...floyd@xxxxxxxxxx (Floyd L. Davidson) writes: ... an environment variable using putenv.... The string needs to be alive for as it is still ... (comp.os.linux.development.apps)
Re: HEADS UP: getenv() and family API change ... putenv takes a char * instead of const char *. ...putenv no longer makes a copy of the input string. ... you should pass a copy of a const string into ... (freebsd-current)