The EINTR error can be raised at any time for any reason, so essentially every I/O operation on a Unix system must be prepared to handle this error properly. Surprisingly to some, this includes the C standard library functions such as fread(), fwrite(), and so on.
I think the editors of C99 and POSIX would be surprised by this too. Any non-buggy fread or fwrite should retry on EINTR.
Any non-buggy fread or fwrite should retry on EINTR.
But maybe not unconditionally retry. Say you got SIGTERM while waiting on network I/O and need to go flush something to disk and exit (instead of just resuming your wait or calling arbitrary code from your signal handler), or you got SIGCHLD on a subprocess and need to clean up stuff related to that.
Apparently "Unix" means "Linux" as the way this can be implemented varies from Unix to Unix.
Actually the introduction of this in the kernel back in '97 or so caused the company I was working for a lot of grief, and a quick recompile, since after a kernel upgrade the binaries we supplied were no longer working reliably.
I think the editors of C99 and POSIX would be surprised by this too. Any non-buggy fread or fwrite should retry on EINTR.