Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

RE: Cygwin: environ problem



>
> Andrej wrote:
> > We _could_try_ to directly manipulate __cygwin_environ, but I do not
> > like it - who knows, where and how it is used. BTW comments
> imply, that
> > DLLs should actually refer to __cygwin_environ :-)
>
> Without some major rewriting, we may have to: the
> export-related machinery
> assumes it has direct control of the (new) environment's
> memory.


There is unfortunately one more problem. Even if we play with
__cygwin_environ, we need to keep local environ's in sync. This is done
inside of cygwin.dll with update_envptrs() function. This function is
local and is not exported (strictly speaking, it does not appear in any
stub library that is installed with cygwin). The private per-DLL user
structures are hidden as well. So, we have no official way to inform
cygwin about changed environment location.

Please, note - that is currently true even without dynamic loading! But
in this case we at least know, that there is single environ variable, so
we can just update both environ and __cygwin_environ.

-andrej



Messages sorted by: Reverse Date, Date, Thread, Author