Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Date: Wed, 28 Sep 2005 18:59:27 -0400 From: Christopher Faylor To: cygwin AT cygwin DOT com Subject: Re: Exec and parent environment Message-ID: <20050928225927.GE26582@trixie.casa.cgf.cx> Reply-To: cygwin AT cygwin DOT com References: <07cbd240f86b06954fe63730c9370fb8 AT swri DOT edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <07cbd240f86b06954fe63730c9370fb8@swri.edu> User-Agent: Mutt/1.5.8i On Wed, Sep 28, 2005 at 11:31:28AM -0500, Joey Mukherjee wrote: >I am having a problem with some Cygwin compiled programs and am hoping >for some advice. I have a menu program which is started from the >Desktop by its icon. In this menu program, I modify the environment >for any child programs that it launches. This works great until the >child program launches a child of its own. > >In the child code, I use execvp to do the launch; however, I don't >believe the child process (grandchild to menu program) is getting the >enviroment variables copied from the parent (child of menu program). > >Does this seem like a bug? Is there a better way to do what I am doing? If you're modifying the environment, you should be using putenv or setenv to do so. If those are truly not working then you should be able to write a simple test case to demonstrate the problem. If you are using the Windows API to set environment variables, then it is possible that an execed cygwin process will not recognize them. You do need to use the cygwin *env functions for manipulating the cygwin environment. http://cygwin.com/problems.html cgf -- 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/