Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!hplabs!hpfcso!stroyan From: stroyan@hpfcso.HP.COM (Mike Stroyan) Newsgroups: comp.sys.hp Subject: Re: Why can't I detect when the child dies? help. Message-ID: <7370084@hpfcso.HP.COM> Date: 18 Feb 90 22:22:42 GMT References: <240@cmic.UUCP> Organization: Hewlett-Packard, Fort Collins, CO, USA Lines: 15 > I'm having a devil of a time with the following scrap of code. It will fork > the child correctly, do all the I/O fine. It's just that the wait from the > parent is never statisfied. The child becomes a zombie process, and won't > go away until the parent is killed. All suggestions greatly appreciated. The parent in your example has opened the master side of pty, while the child has opened the slave side of the same pty. If you have asked for TIOCTRAP on the pty, then a close on the slave side will block until the master side handshakes it. When the child tries to exit, it will attempt to close the pty on the way out. Until the parent handshakes the close the child will not completely exit, and the wait() for the child will not complete. Perhaps you could watch for a close operation before doing a wait() or waitpid() for the corresponding process. Mike Stroyan, stroyan@hpfcla.hp.com