This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Exec and parent environment


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]