replacing getenv/setenv on Windows - ticket 2636

Jeffrey Hutzelman jhutz at
Thu Sep 21 21:03:19 EDT 2006

On Thursday, September 21, 2006 08:15:43 PM -0400 Jeffrey Altman 
<jaltman at> wrote:

> UNIX system processes share a single environment.  On Windows they do
> as well, but only if you using the SetEnvironmentVariable and
> GetEnvironmentVariable APIs to manipulate it.

No.  UNIX processes do _not_ share a single environment.  Each process gets 
a copy of its parent's environment when it is created; once a process is 
created there is no way to affect its environment externally.  Unlike the 
Windows SetEnvironmentVariable call, setenv() does not affect the 
environment of any existing process; it affects only the process which made 
the call and any children forked after the call to setenv().

I think what you're trying to say is that an environment change made by an 
application which uses the Kerberos library may not be visible to the 
library even though they're in the same process.  I agree that that is an 
issue; however, the alternative is that changes made by other processes 
_do_ become visible to the library, and vice versa, and that could be a 
problem as well.

-- Jeff

More information about the krbdev mailing list