Re: Ctrl+C doesn't interrupt process waiting for I/O

From: David Newall
Date: Sun Jun 29 2008 - 03:24:27 EST


Jeremy Fitzhardinge wrote:
> Török Edwin wrote:
>> ...
>> - I have a (I/O bound) process running in my terminal, and I want to
>> interrupt it with Ctrl+C
>> - I type Ctrl+C several times, and the process is not interrupted for
>> several seconds (10-30 secs)
>> - if I type Ctrl+Z, and use kill %1 the process dies faster than
>> waiting for it to react to Ctrl+C
>
> Yes, it's intended behaviour. Filesystem IO syscalls are considered
> "fast" and are interruptible. Usermode code can reasonably expect
> that file IO will never return EINTR.

This does not address the symptom that the process can be killed quicker
by sending a SIGTERM. I've noticed the problem, too (2.6.25.) I wonder
if it isn't some strangeness in the tty layer (hence the interrupt key
is slower than an explicitly sent signal.)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/