From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15482 invoked by alias); 10 May 2012 17:57:16 -0000 Received: (qmail 15466 invoked by uid 22791); 10 May 2012 17:57:15 -0000 X-SWARE-Spam-Status: No, hits=-5.1 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-vb0-f43.google.com (HELO mail-vb0-f43.google.com) (209.85.212.43) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 10 May 2012 17:57:02 +0000 Received: by vbbfq11 with SMTP id fq11so2371453vbb.2 for ; Thu, 10 May 2012 10:57:01 -0700 (PDT) MIME-Version: 1.0 Received: by 10.52.68.228 with SMTP id z4mr2588574vdt.1.1336672621646; Thu, 10 May 2012 10:57:01 -0700 (PDT) Received: by 10.220.139.144 with HTTP; Thu, 10 May 2012 10:57:01 -0700 (PDT) In-Reply-To: <054d01cd2ec9$e6f4f5d0$b4dee170$@motionview3d.com> References: <020501cd23f2$20f07620$62d16260$@motionview3d.com> <20120427143753.GO25385@calimero.vinschen.de> <025501cd24c6$6a353990$3e9facb0$@motionview3d.com> <4F9B38FB.9030607@dancol.org> <20120428052727.GA23749@ednor.casa.cgf.cx> <4F9BD262.2000403@dancol.org> <4FAABEAE.7000309@tlinx.org> <053b01cd2e18$f3f9ce60$dbed6b20$@motionview3d.com> <20120509201147.GD22015@ednor.casa.cgf.cx> <054d01cd2ec9$e6f4f5d0$b4dee170$@motionview3d.com> Date: Thu, 10 May 2012 17:57:00 -0000 Message-ID: Subject: Re: Cygwin passes through null writes to other software when redirecting standard input/output (i.e. piping) From: Earnie Boyd To: cygwin@cygwin.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com X-SW-Source: 2012-05/txt/msg00210.txt.bz2 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 w= as > 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 load= ed > 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 concurren= tly > loaded by someone else? =C2=A0I 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? = =C2=A0(I > realize Cygwin has extensive IPC and shared memory mechanisms, some of wh= ich > 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, --=20 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