Erik Trauschke <erik.trausc...@freenet.de> wrote:

> I'm currently tinkering with sigtimedwait() to timeout a process I
> forked by setting it up to listen for SIGCHLD. 
> 
> What strikes me as odd is that I have to define a bogus signal-handler
> routine to make it work, otherwise no SIGCHLD is even received by the
> parent process.
> 
> I attached a simplified example to this mail. All it does is setting up
> a signalset for SIGCHLD, fork a process and wait with sigtimedwait() for
> the child to exit. Which should happen immediately. However, when
> sigaction() with the bogus handler is not called, sigtimedwait() times
> out because it receives no SIGCHLD (truss also shows no SIGCHLD raised)
> 
> So is there anything wrong with the approach or am I just too stupid?
> 
> Any hints or comments would be appreciated

Hi Erik.

You are doing everything right.
Solaris is doing the wrong thing in this case.
I filed this bug report to address the problem:

6857047 sigwait malfunctions for system-generated SIGCHLD signals

I expect to have it fixed soon, build snv_119 (or snv_120 at worst).

In the meantime, setting up the bogus handler is a good workaround.

Thanks for the test case.

Roger Faulkner
Sun Microsystems

_______________________________________________
opensolaris-code mailing list
opensolaris-code@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to