Truncated Environment Variables? - using Cygwin + GetEnvironmentStrings() WIN32 API

Kaveh Goudarzi kaveh@arkasoft.com
Sun Apr 30 05:18:00 GMT 2006


Hi Eric/Brian,
	
	Thanks for your responses.  I hope you don't mind
answering a few more questions :-)

1. is it possible to somehow force cygwin to always sync
the env with windows prior to spawning a child process (any
child process)?

2. How does cygwin work out if it's spawning a cygwin or
non-cygwin binary?  (is it based on refs to cygwin1.dll?)
(is it the loader that does this?)

3. Brian mentioned a call to cygwin_internal(CW_SYNC_WINENV)
In my scenario (see below) I'd have to work out if the target
process was a cygwin proc or not before I tried to invoke this
method ... is there a painless way of working out if a process
is cygwin or not e.g. one that would give me a response whether
the process I'm querying is a cygwin or a native win app?

Why I need the env:
---------------------
	I'm working on a tool which aims to automatically
intercept code builds (e.g. make, nmake etc.) and produce
alternative versions of the compiled code with some enhancements.
The aim is to do this transparently so all a developer need do
is run my spy program, then do a make clean, make and we would
catch all the build commands, grab the command line, working dir
and environment passed to gcc for example and use that info in
the enhanced "compiler" to produce the alternative build.  The
target builds however are not necessarily all cygwin based - e.g.
could be MS builds done via nmake or even an IDE.

Thanks again for your help!

Kaveh.

PS. Eric - I figure that since this is generic cygwin behaviour
there isn't any point in attaching the result of cygcheck now... let
me know if it adds anything and I'll attach it in the next e-mail.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list