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 Subject: Re: detecting child processes? In-reply-to: X-012-Sender: halo1 AT inter DOT net DOT il To: djgpp AT delorie DOT com Message-id: <83vbtctb77.fsf@gnu.org> References: 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 Precedence: bulk > From: "Rod Pemberton" > 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.