Path: utzoo!attcan!uunet!husc6!mailrus!tut.cis.ohio-state.edu!bloom-beacon!gatech!purdue!decwrl!hplabs!hpda!hpcupt1!hpisod2!decot From: decot@hpisod2.HP.COM (Dave Decot) Newsgroups: comp.unix.wizards Subject: Re: processes (was Re: Trouble killing processes in SysV/AT) Message-ID: <14020041@hpisod2.HP.COM> Date: 13 May 88 19:14:32 GMT References: <77@lakart.UUCP> Organization: Hewlett Packard, Cupertino Lines: 17 > P.S. In response to all those that replied to my questions Re: > processes, I discover the solution is simple. After every fclose(fp), where > fp is the FILE * I got from popen, I do a wait(&j), and the zombies go away. I'm surprised nobody mentioned to you that the routine pclose() (and not fclose()) is supposed to be called to close stdio streams obtained from popen(). Among other things, pclose() calls wait() to pick up the status of the finished process and get rid of the zombie. Pclose() is usually documented on the same page as popen(), so I don't understand how everybody could have missed this. Dave Decot Hewlett-Packard Company decot%hpda@hplabs.hp.com