[PROPOSED PATCH] wait4 and SIGCHLD

Michiel Boland (boland@sci.kun.nl)
Fri, 28 Jun 1996 16:18:53 +0200


As mentioned earlier on linux-kernel, Linux discards any pending
SIGCHLD signals when a process calls one of the wait() functions.
I don't know of any other unix that does this, so I hereby
propose a patch that will bring Linux back in sync (hopefully :).

The patch is against 2.0.0.

I am running a kernel with this patch at the moment, and am
experiencing no problems whatsoever, except that the system does
not boot after I exit an emergency shell, but that is a bug in
sysvinit-2.62.

P.S. this is my first patch, so please be gentle :)

*** kernel/exit.c.orig Mon Jun 3 11:26:38 1996
--- kernel/exit.c Thu Jun 27 14:39:08 1996
***************
*** 668,674 ****
goto end_wait4;
current->state=TASK_INTERRUPTIBLE;
schedule();
- current->signal &= ~(1<<(SIGCHLD-1));
retval = -ERESTARTSYS;
if (current->signal & ~current->blocked)
goto end_wait4;
--- 668,673 ----

-- 
Michiel Boland <boland@sci.kun.nl>
University of Nijmegen
The Netherlands