System V / SIGCLD questions...

Erik Murrey murrey at lehi3b15.csee.Lehigh.EDU
Sat May 13 10:56:59 AEST 1989


In article <17457 at mimsy.UUCP> chris at mimsy.UUCP (Chris Torek) writes:
>In article <565 at lehi3b15.csee.Lehigh.EDU> murrey at lehi3b15.csee.Lehigh.EDU
>(Erik Murrey) writes:
>> ...
> ...
>This means that a catcher routine written as
>
>	catch()
>	{
>		int w, status;
>
>		signal(SIGCLD, catch);
>		w = wait(&status);
>	}
>
>recurses infinitely as soon as one child exits.

Yes, and in fact I tried this once before, and it did go into
an endless loop after the first catch().

So my solution is to reset the sigcld signal after the wait(). Doesn't
this leave a window where a child can die, and I won't ever know about
it?

At least they could have given me a SIG_HOLD...

.
.
.
.

-- 
Erik Murrey
Lehigh University
murrey at csee.Lehigh.EDU
erik at mpx.com



More information about the Comp.unix.wizards mailing list