From: Chris Hanson
you should virtually never use read(2), only ever
something like this:
...
And do this for every classic system call, since virtually no client
code should ever have to care about EINTR.
"Virtually". Maybe there are places that want to know if their read call was
interrupted; if you don't make this version available to them, how can they
tell? Leaving the user as much choice as possible is the only way to go, IMO;
why force them to do it the way _you_ think is best?
And it makes the OS simpler; any time you can move functionality out of the
OS, to the user, that's a Good Thing, IMO. There's nothing stopping people
from using the EINTR-hiding wrapper. (Does the Standard I/O library do this,
does anyone know?)
Noel
PS: Only system calls that can block can return EINTR; there are quite a few
that don't, not sure what the counts are in modern Unix.