From owner-freebsd-questions Wed Jan 19 14:44:42 2000 Delivered-To: freebsd-questions@freebsd.org Received: from inet03.citec.qld.gov.au (inet03.citec.qld.gov.au [203.5.10.10]) by hub.freebsd.org (Postfix) with ESMTP id E587415354 for ; Wed, 19 Jan 2000 14:44:29 -0800 (PST) (envelope-from sgcccdc@citec.qld.gov.au) Received: by inet03.citec.qld.gov.au; id IAA03855; Thu, 20 Jan 2000 08:44:23 +1000 (EST) Received: from guru.citec.qld.gov.au( 147.132.20.47) by inet03.citec.qld.gov.au via smap (V2.0) id xma003647; Thu, 20 Jan 00 08:44:16 +1000 Received: from localhost (sgcccdc@localhost) by guru.citec.qld.gov.au (8.9.3/8.9.3) with ESMTP id IAA18200 for ; Thu, 20 Jan 2000 08:45:16 +1000 X-Authentication-Warning: guru.citec.qld.gov.au: sgcccdc owned process doing -bs Date: Thu, 20 Jan 2000 08:45:16 +1000 (EST) From: Colin Campbell To: freebsd-questions@FreeBSD.ORG Subject: Re: Detecting when your parent process dies. In-Reply-To: <200001191814.TAA22396@dorifer.heim3.tu-clausthal.de> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hi, On Wed, 19 Jan 2000, Oliver Fromme wrote: > Scott Hess wrote in list.freebsd-questions: > > I may not have been complete enough in my description. I'm using rfork() > > _without_ RFFDG or RFCFDG. This means that the parent and child share file > > descriptor tables. That means that the above fix won't work, because even > > if the parent process exits, the pipe will still be open on both ends (as > > long as one or more children live), so you'll never detect EOF. > > > > I suspect that this also means that most file descriptor based tricks won't > > work, because of the shared file descriptor table. > > In that case, there is no other way except polling the PID > (which is not only inefficient, but also not reliable). > kWhat about "polling" using getppid(). If the parent dies, the PPID will change (to 1?), will it not? Colin To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message