Path: utzoo!attcan!uunet!samsung!zaphod.mps.ohio-state.edu!rpi!uupsi!sunic!lth.se!newsuser From: jh@efd.lth.se (Joergen Haegg) Newsgroups: comp.unix.wizards Subject: forking and zombies in SYSV. Message-ID: <1990Aug20.133107.12516@lth.se> Date: 20 Aug 90 13:31:07 GMT References: <1990Aug19.210351.24632@dde.dk> Sender: newsuser@lth.se (LTH network news server) Reply-To: jh@efd.lth.se (Joergen Haegg) Organization: Lund Institute of Technology, Sweden Lines: 26 A question about how to fork() in SYSV. I want to fork, and the parentprocess should continue without doing a wait(). When the child exits, it is transformed into a zombieprocess. The zombie exists until the parent exits. This is as it should be according to SVID. How do I avoid getting this zombie? The only way, am I told, is to let the child fork again and exit. The parent will wait() for the first child, but not the child of the first child. The second child will not create a zombie, because the parent (the first child) is dead. This seems a bit silly, because /etc/init forks all the time and without any zombies. (Ok, init is maybe a little special :-) Is there not a cleaner way to do this? -- -- Joergen Haegg jh@efd.lth.se postmaster@efd.lth.se System manager @ efd 046-107492 Lund Institute of Technology Sweden