Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 09 Jul 1996 20:14:14 +0100
From:      "Gary Palmer" <gpalmer@FreeBSD.ORG>
To:        Brandon Gillespie <brandon@tombstone.sunrem.com>
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: handling SIGCHLD with multiple children 
Message-ID:  <28527.836939654@palmer.demon.co.uk>
In-Reply-To: Your message of "Tue, 09 Jul 1996 12:26:35 MDT." <Pine.BSF.3.91.960709122409.4725A-100000@tombstone.sunrem.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
Brandon Gillespie wrote in message ID
<Pine.BSF.3.91.960709122409.4725A-100000@tombstone.sunrem.com>:
> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?28527.836939654>