Re: SIGCONT misbehaviour in Linux

Simon Patience (sp@albion.engr.sgi.com)
Fri, 10 Dec 99 08:18:50 -0800


Ulrich Drepper wrote:
|> Andrea Arcangeli <andrea@suse.de> writes:
|>
|> > Do you agree that ^Z is just correct returning -EINTR immediatly at
|> > SIGCONT time (aka `fg` time)?
|>
|> This is not what happens on other platforms. At least with my limited
|> testing I found that if you do on Solaris
|>
|> sleep 10
|> ^Z
|> fg
|>
|> the process will continue to sleep.

I am with Ulrich on this one. The problem with job control signals is
that they are not really signals directed towards the process, they are
signals directed to the kernel to do something to the process. In the
case of STOP/CONT it is a request to not allow/allow the process to
make forward progress _in user space_. Sending the signal should not
interrupt the process at all.

Sending SIGSTOP should simply mark the process as not to return to user
space. If the process happens to be already blocked in the kernel
waiting for something, there is no reason to interrupt so it can be
blocked somewhere else in the kernel. If it wakes up then it can
complete the system call successfully but then block before returning
to user space. SIGCONT would simply clear that flag and wake the
process up if it was in a job control stop.

Simon.

----
Simon Patience Phone: (650) 933-4644
Silicon Graphics, Inc FAX: (650) 962-8404
1600 Amphitheatre Pkwy Email: sp@sgi.com
Mountain View, CA 94043-1389

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/