Cygwin passes through null writes to other software when redirecting standard input/output (i.e. piping)

Earnie Boyd
Thu May 10 17:57:00 GMT 2012

On Thu, May 10, 2012 at 12:28 PM, James Johnston wrote:
> Forgive me for asking perhaps a dumb question, but I was reading the page at
> and wasn't too sure what was
> meant by the sentence "All Windows environment variables are imported when
> Cygwin starts" - which I assume includes parsing and using CYGWIN option?
> Is it: (1) the variables are processed the first time CYGWIN1.DLL is loaded
> into a process, and then never used again thereafter, or (2) every time a
> process linking with CYGWIN1.DLL loads - even if CYGWIN1.DLL is concurrently
> loaded by someone else?  I would assume it is #2....
> Or to phrase another way: does Cygwin "start" once when the first process
> linking to it is loaded, or does it "start" every time a process loads?  (I
> realize Cygwin has extensive IPC and shared memory mechanisms, some of which
> is probably done only on first load of first process to initialize shared
> memory, which is what prompted this question.)

IIRC Cygwin processes the Windows environment upon initial parent
process load and stores it internally for each parent process.  Child
processes inherit the environment of the parent.  So if I start to
shell command windows both look the same on start-up but if I modify
one of the environments in one command window the other is unaffected.
 If I start a process in the changed environment then the subsequent
process will have the changed environment.


Problem reports:
Unsubscribe info:

More information about the Cygwin mailing list