Mail Archives: djgpp-workers/2002/10/28/15:18:17
> 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 -