Query on signal handling



Hi,
I am using Red Hat Enterprise Linux Release 4 (Nahant Update 3). I
need some clarification regarding how kernel delivers SIGCHLD.

I have a parent that installs handler for SIGCHLD. Currently, it calls
a wait(&pid) within the handler and is responsible for cleaning up the
child.

If I simultaneously kill 3 childs (by issuing kill -9 child1 child2
child3) I don't see the handler getting called 3 times. This happens
in a nondeterministic way.

What is the proper way of getting around this problem? Can we use
wait3/wait4 with WNOHANG?
Please suggest

Thanks
Sunny
.


Quantcast