10-19-04 07:48 AM
On Mon, 18 Oct 2004, Rookie wrote:
> I am trying to pass a kill(childpid,signal) from a parent process to a chi
ld
> process when the parent receives a SIGINT signal. I am able to catch the
> signal properly at the parent.
>
> But unfortunately when I press ctrl-C only the parent's signal handler is
> executing (which is printing a line and sending kill's to the children).I
Source code, please. Also, printing a line (in fact, calling any of the
standard IO library functions) is not a good idea from a signal handler
(although in a small program you might get away with it).
> Firstly I would appreciate it if someone could tell me what I am doing
Hard to see without seeing your code.
> wrong. And also whats this <defunct> process thing?
A defunct process is a zombie--and a zombie is a process that
has died and whose status hasn't been reaped by its parent.
If the zombie's parent terminates before reaping the child's
status, the child is inherited by init, and IT reaps the
child's status.
I explain all this in greater detail in my book, Solaris
Systems Programming. Have a look around the book's web site
(www.rite-group.com/rich/ssp), and perhaps order a copy from
Amazon.com using the link supplied.
HTH,
--
Rich Teer, SCNA, SCSA, author of "Solaris Systems Programming",
published in August 2004.
President,
Rite Online Inc.
Voice: +1 (250) 979-1638
URL: http://www.rite-group.com/rich
[ Post a follow-up to this message ]
|