delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2014/05/11/14:36:18

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
X-Recipient: djgpp AT delorie DOT com
Date: Sun, 11 May 2014 21:35:56 +0300
From: Eli Zaretskii <eliz AT gnu DOT org>
Subject: Re: detecting child processes?
In-reply-to: <op.xfpixiqe6zenlw@localhost>
X-012-Sender: halo1 AT inter DOT net DOT il
To: djgpp AT delorie DOT com
Message-id: <83vbtctb77.fsf@gnu.org>
References: <op DOT xfpixiqe6zenlw AT localhost>
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> From: "Rod Pemberton" <dont_use_email AT xnothavet DOT cqm>
> Date: Sun, 11 May 2014 13:59:32 -0400
> 
> I have a process which spawns a child of itself via system().
> 
> Although the parent and child are the same application, I'd now
> like the child to function slightly differently from the parent.
> To do that, I need to be able to detect that the child is not
> the parent.  How is that usually done in DJGPP or DOS?

Does the argument passed to 'system' use anything that would need to
invoke the child via command.com?  If not, you should be able to see
the " !proxy" variable in the environment of the child.  Also, if the
original command line (in the PSP) starts with "!proxy ", that's also
a sign that it was invoked by a DJGPP parent.

- Raw text -


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