From owner-freebsd-hackers Tue Jul 9 12:14:45 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id MAA29106 for hackers-outgoing; Tue, 9 Jul 1996 12:14:45 -0700 (PDT) Received: from palmer.demon.co.uk (palmer.demon.co.uk [158.152.50.150]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id MAA29101 for ; Tue, 9 Jul 1996 12:14:39 -0700 (PDT) Received: from palmer.demon.co.uk (localhost [127.0.0.1]) by palmer.demon.co.uk (sendmail/PALMER-2) with ESMTP id UAA28529; Tue, 9 Jul 1996 20:14:16 +0100 (BST) To: Brandon Gillespie cc: freebsd-hackers@FreeBSD.ORG From: "Gary Palmer" Subject: Re: handling SIGCHLD with multiple children In-reply-to: Your message of "Tue, 09 Jul 1996 12:26:35 MDT." Date: Tue, 09 Jul 1996 20:14:14 +0100 Message-ID: <28527.836939654@palmer.demon.co.uk> Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk Brandon Gillespie wrote in message ID : > 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? Do you really need to sit on SIGCHLD or can you use waitpid()? Or you could perhaps even use waitpid() in the SIGCHLD handler, with WNOHANG option, to see which child exited... Gary -- Gary Palmer FreeBSD Core Team Member FreeBSD: Turning PC's into workstations. See http://www.FreeBSD.ORG/ for info