From: "Ron Harter" <rharter@flash.net>
Subject: Re: Child process notification
Date: 1997/09/03 [thread overview]
Message-ID: <01bcb80b$9132fc40$36461ed1@guiness> (raw)
In-Reply-To: 340C6EFD.7B3A@lads.com
Billy Quinn <bquinn@lads.com> wrote in article <340C6EFD.7B3A@lads.com>...
>
> Hi all,
> I have an application running on DU 4.0b , which has a
> number of forked child processes. However , if I kill this application
> , the children get orphaned off to PID 1 (The normal behaviour). I
> was wondering if any signal is given to the child by the parent or
> if there was any way of detecting this on the child side so I could
> destruct it cleanly. Any help would be greatly appreciated.
> TIA
> Billy
The easiest method is to check the parent process id, if it is 1 then init
has become the parent.
The call looks something like this
ppid = getppid();
There are a couple of other ways to do it using semaphores that are more
complicated.
prev parent reply other threads:[~1997-09-03 4:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
1997-09-02 4:00 Child process notification Billy Quinn
1997-09-03 4:00 ` Ron Harter [this message]
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox