From owner-freebsd-hackers Mon Sep 1 20:52:33 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id UAA11456 for hackers-outgoing; Mon, 1 Sep 1997 20:52:33 -0700 (PDT) Received: from implode.root.com (implode.root.com [198.145.90.17]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id UAA11449 for ; Mon, 1 Sep 1997 20:52:29 -0700 (PDT) Received: from implode.root.com (localhost [127.0.0.1]) by implode.root.com (8.8.5/8.8.5) with ESMTP id UAA17302; Mon, 1 Sep 1997 20:54:13 -0700 (PDT) Message-Id: <199709020354.UAA17302@implode.root.com> To: "Jamil J. Weatherbee" cc: Greg Lehey , freebsd-hackers@FreeBSD.ORG Subject: Re: SIGCLD In-reply-to: Your message of "Mon, 01 Sep 1997 20:41:37 PDT." From: David Greenman Reply-To: dg@root.com Date: Mon, 01 Sep 1997 20:54:13 -0700 Sender: owner-freebsd-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk >what I am asking is if there is any differnce between > > wait3 (&status, 0, (struct rusage *) NULL); > >and > > while (wait3(&status, WNOHANG, (struct rusage *) 0)>0); > >which is what stevens uses in his book. Yes, there is a difference. SIGCHLD signal delivery isn't reliable, so if a SIGCHLD is missed, it is possible that more than one process needs to be reaped. The first form will only reap on child, while the second form reaps all of them. You want to use the second form. -DG David Greenman Core-team/Principal Architect, The FreeBSD Project