From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,34d74a3db77f2aec X-Google-Attributes: gidfee84,public From: "Ron Harter" Subject: Re: Child process notification Date: 1997/09/03 Message-ID: <01bcb80b$9132fc40$36461ed1@guiness>#1/1 X-Deja-AN: 269981725 References: <340C6EFD.7B3A@lads.com> Organization: Flashnet Communications, http://www.flash.net Newsgroups: comp.unix.osf.osf1 Billy Quinn 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.