Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
* Child process notification
@ 1997-09-02  4:00 Billy Quinn
  1997-09-03  4:00 ` Ron Harter
  0 siblings, 1 reply; 2+ messages in thread
From: Billy Quinn @ 1997-09-02  4:00 UTC (permalink / raw)




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



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Child process notification
  1997-09-02  4:00 Child process notification Billy Quinn
@ 1997-09-03  4:00 ` Ron Harter
  0 siblings, 0 replies; 2+ messages in thread
From: Ron Harter @ 1997-09-03  4:00 UTC (permalink / raw)





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.




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1997-09-03  4:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1997-09-02  4:00 Child process notification Billy Quinn
1997-09-03  4:00 ` Ron Harter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox