From owner-freebsd-hackers Tue Jul 9 13:11:02 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id NAA02944 for hackers-outgoing; Tue, 9 Jul 1996 13:11:02 -0700 (PDT) Received: from shogun.tdktca.com ([206.26.1.21]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id NAA02929 for ; Tue, 9 Jul 1996 13:10:53 -0700 (PDT) Received: from shogun.tdktca.com (daemon@localhost) by shogun.tdktca.com (8.7.2/8.7.2) with ESMTP id PAA21110 for ; Tue, 9 Jul 1996 15:11:29 -0500 (CDT) Received: from fa.tdktca.com (bsd.fa.tdktca.com [163.49.131.129]) by shogun.tdktca.com (8.7.2/8.7.2) with ESMTP id PAA21095 for ; Tue, 9 Jul 1996 15:11:28 -0500 (CDT) Received: (from alex@localhost) by fa.tdktca.com (8.7.5/8.6.12) id PAA14777; Tue, 9 Jul 1996 15:14:19 -0500 (CDT) Date: Tue, 9 Jul 1996 15:14:19 -0500 (CDT) From: Alex Nash To: Brandon Gillespie cc: freebsd-hackers@freebsd.org Subject: Re: handling SIGCHLD with multiple children In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk On Tue, 9 Jul 1996, Brandon Gillespie wrote: > Is there _ANY_ way of finding what child sent a SIGCHLD signal to the > parent process? I have a situation where a parent may have multiple > children processing different tasks, and the parent is waiting for one > child to complete a specific task, which it cares about, but it does not > care about the other children. Because of this in most instances when > SIGCHLD is received it simply resets it and continues working, except for > now I need to handle things differently when a specific child sends > SIGCHLD. Is there any ANY way to figure out where it came from? > > Thanks.. > > -Brandon > See the man page for wait3: RETURN VALUES If wait() returns due to a stopped or terminated child process, the pro- cess ID of the child is returned to the calling process. Otherwise, a value of -1 is returned and errno is set to indicate the error. Alex