This is the mail archive of the mailing list for the Cygwin project. See the Cygwin home page for more information.
Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: putenv does not put env into win32?

Eugene Kanter <> writes:
> I guess cygwin putenv() MUST call SetEnvironmentVariable() at the end. I
> see no excuses for that.

Chris/Geoffrey/DJ can comment on the reason, but I'd guess it's mostly a
performance related issue.

> Just for test, I tried to call just SetEnvironmentVariable() and it does
> not update cygwin variable. Are there the different sets of variables?

Cygwin caches the environment variables at startup by calling
GetEnvironmentStrings and then uses its local copies. Performance
again. Using cygwin_conv_* routines are rather heavy-weight.

Perhaps there is a set of env variables, such as PATH, that should always 
be kept in sync at the expense of a little performance loss? 


Want to unsubscribe from this list?
Send a message to