3 ms·
Simplest solution would be for libc to export some flag that could be set in signal handler signifying that I/O operation should be aborted. as for the simpler
by dfox 14y ago
Simplest solution would be for libc to export some flag that could be set in signal handler signifying that I/O operation should be aborted.
as for the simpler kernel, I think that windows NT/VMS solution where user code has to explicitly block on I/O completion is simpler kernel-wise, but leads to unnecessary complexity in applications (which is abstracted away by winapi, but it's sometimes leaky abstraction). On the other hand, most common application for interrupting syscalls is timeouts and then killing the thread is most often what you want.
In all, EINTR is not way to find out that there was an signal during syscall but an hack to get process to meaningful state the easiest possible way when signal handler runs. By the way for some syscalls post-2.6 linux does something reasonably similar to ITS' pclusering transparently without returning EINTR.