delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2002/10/28/15:18:17

Date: Mon, 28 Oct 2002 21:24:39 +0300
From: "Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il>
Sender: halo1 AT zahav DOT net DOT il
To: uue AT pauzner DOT dnttm DOT ru
Message-Id: <1438-Mon28Oct2002212439+0200-eliz@is.elta.co.il>
X-Mailer: emacs 21.3.50 (via feedmail 8 I) and Blat ver 1.8.9
CC: djgpp-workers AT delorie DOT com
In-reply-to: <2.7.9.SDH.H4P0V2@pauzner.dnttm.ru> (uue@pauzner.dnttm.ru)
Subject: Re: libc' getenv optimization (patch3)
References: <Pine DOT SUN DOT 3 DOT 91 DOT 1021028074013 DOT 9027A-100000 AT is> <2 DOT 7 DOT 9 DOT SDH DOT H4P0V2 AT pauzner DOT dnttm DOT ru>
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> From: "Leonid Pauzner" <uue AT pauzner DOT dnttm DOT ru>
> Date: Mon, 28 Oct 2002 16:16:14 +0300 (MSK)
> 
> > ??? I meant to ask whether you tested your code with programs that call
> > functions from dosexec.c, since they poke environ[].
> 
> I have not tested this, and I do not understand this code in details.
> As far as I could see they look(=read) comspec and proxy variables directly
> and pass env[] array to next stage unchanged, but with write permissions.

No, dosexec.c removes any variables special to its own operation, such
as " !proxy", from the environment.  This is done so that if the child
program invokes another one, the grandchild would not use the same
command-line arguments used by the child, and similarly with the
CMDLINE variable.

> I thought the spawned process should have its own environment
> but have not found a point where env[] duplicated so parent have its copy.

The function direct_exec_tail_1 puts the environment for the child in
the DOS buffer used to invoke the child, and puts a pointer to that
environment into the DOS Exec parameter block.

> Also I have not found the point where __environ_changed variable incremented
> in dosexec

That's because __environ_changed is not modified: dosexec only changes
the copy of the environment passed to the child, not its own
environment.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019