System V and SIGCLD

Keith Crews keith at enmasse.UUCP
Sat May 10 00:45:30 AEST 1986


In article <709 at cheviot.uucp> lindsay at cheviot.newcastle.ac.uk (Lindsay F. Marshall) writes:
>The following code goes into an infinite loop on System V :-
>
>
>The problem is that resetting the SIGCLD trap inside the handler causes the
>signal to be raised again and the handler to be re-entered...... This
>is not documented in the manual page and seems to me to be a bug as if you
>do not reset the handler the system seems to set it to SIG_DFL, meaning that
>you will loose any SIGCLD signals between the handler's exit and your getting
>a chance to call signal again. Anyone have any thoughts, information etc. on
>this problem??

The signal is raised again because the child still exists.  To do what you want
you have to do a wait in the signal handler before resetting the signal.
This explaination is due to a fellow employee - any errors in conveying it
are no doubt due to me.  In my system V manual there is a discussion of
what happens to SIGCLD while the signal catcher is executing, but it
does not seem to imply this behavior.

		Keith Crews



More information about the Comp.unix.wizards mailing list