Re: another subtle signals issue

From: Linus Torvalds (
Date: Tue Feb 11 2003 - 22:10:25 EST

On Tue, 11 Feb 2003, Daniel Jacobowitz wrote:
> For things with a timeout, shouldn't they be converted to use
> ERESTART_RESTARTBLOCK? The situation Roland is describing is just
> about the same as the original problem with nanosleep.

The thing is, I don't think the case Roland is describing is the _real_

The real case you want to look at is a simple pipe read. See fs/pipe.c,
pipe_read(), and grok it (or "pipe_write()", for that matter).

It should not return early for something like a SIGWINCH that is ignored.
Returning early literally breaks things like old versions of "tar" that
want full-sized reads and don't do internal blocking on their own etc.

Now, if a user does ^Z or somebody ptrace's you, we _have_ to return out
of the read(), and return a partial result. Fair enough. We'd prefer a
ptrace to not perturb the results at all, but that's just not possible
with the way tracing works. But there are signals that truly don't do
anything, and those we _can_ avoid causing partial reads. SIGWINCH is one
(very common) example.

I think this is even codified in POSIX, but if it isn't, I don't much
care: it's also a quality of implementation issue.

And the simple way to do this right is to not set TIF_SIGPENDING if you
don't have to.


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

This archive was generated by hypermail 2b29 : Sat Feb 15 2003 - 22:00:36 EST