Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!husc6!cmcl2!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn ) Newsgroups: comp.unix.questions Subject: Re: Avoiding processes on Ultrix Message-ID: <10012@smoke.BRL.MIL> Date: 9 Apr 89 01:50:49 GMT References: <520@pan.UUCP> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 19 In article <520@pan.UUCP> jw@pan.UUCP (Jamie Watson) writes: >Is there any way under Ultrix (2.0 or later) to write a C program >such that any child processes created by that program will exit, >without hanging in an status until the parent does a wait() >for the child? Under SysV this is done with signal(SIGCLD, SIG_IGN); >I have tried that under Ultrix, to no avail. Ugh! NEVER use the SIGCLD kludge! To create a child that will not become a long-lived zombie: if ( fork() == 0 ) if ( fork() == 0 ) exec( whatever ); else _exit( 0 ); Since the grandchild has no parent, whenever it terminates it will be reaped by the "init" special process.