Re: [PROPOSED PATCH] wait4 and SIGCHLD

Marc Aurele La France (Marc.La-France@ualberta.ca)
Wed, 3 Jul 1996 08:14:24 -0600 (MDT)


On Fri, 28 Jun 1996, Michiel Boland wrote:

> 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 :).

> *** 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 ----

I think pending SIGCHLD signals should be discarded if the signal handler
is SIG_IGN. Otherwise, do_signal will just end up reinvoking sys_wait4,
which won't necessarily hurt, but is a waste of time.

Marc.

+----------------------------------+-----------------------------------+
| Marc Aurele La France | work: 1-403-492-9310 |
| Computing and Network Services | fax: 1-403-492-1729 |
| 352 General Services Building | email: tsi@ualberta.ca |
| University of Alberta +-----------------------------------+
| Edmonton, Alberta | |
| T6G 2H1 | Standard disclaimers apply |
| CANADA | |
+----------------------------------+-----------------------------------+