public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Earnie Boyd <earnie@users.sourceforge.net>
To: cygwin@cygwin.com
Subject: Re: Cygwin passes through null writes to other software when redirecting standard input/output (i.e. piping)
Date: Thu, 10 May 2012 17:57:00 -0000	[thread overview]
Message-ID: <CA+sc5mntrGeSyzu-8Vv8g_gg9nNTH52hzgztrfCO9Qq-q5KvNw@mail.gmail.com> (raw)
In-Reply-To: <054d01cd2ec9$e6f4f5d0$b4dee170$@motionview3d.com>

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
> http://cygwin.com/cygwin-ug-net/setup-env.html 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.

HTH,
-- 
Earnie
-- https://sites.google.com/site/earnieboyd

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

  parent reply	other threads:[~2012-05-10 17:57 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-26 21:19 James Johnston
2012-04-27  0:17 ` Christopher Faylor
2012-04-27 14:26   ` James Johnston
2012-04-27 16:28     ` Christopher Faylor
2012-04-27 15:12   ` jojelino
2012-04-27 16:28     ` Christopher Faylor
2012-04-27  9:09 ` cygwin
2012-04-27 14:41   ` Christopher Faylor
2012-04-27 14:38 ` Corinna Vinschen
2012-04-27 22:38   ` James Johnston
2012-04-28  0:25     ` Daniel Colascione
2012-04-28  5:27       ` Christopher Faylor
2012-04-28 11:20         ` Daniel Colascione
2012-05-09 19:00           ` Linda Walsh
2012-05-09 19:21             ` James Johnston
2012-05-09 20:12               ` Christopher Faylor
2012-05-10 16:28                 ` James Johnston
2012-05-10 16:33                   ` Otto Meta
2012-05-10 17:57                   ` Earnie Boyd [this message]
2012-05-10 18:39                     ` Corinna Vinschen
2012-05-11  9:05                       ` Andrey Repin
2012-05-11  3:34                 ` Daniel Colascione
2012-05-11  5:08               ` Linda Walsh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CA+sc5mntrGeSyzu-8Vv8g_gg9nNTH52hzgztrfCO9Qq-q5KvNw@mail.gmail.com \
    --to=earnie@users.sourceforge.net \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).