The Often-Forgotten EINTR
- What they do NOT teach in "Intro To OS 101", is that system calls are
sometimes aborted prematurely if the process running them received a
signal.
- In this case, the system call will return an error (-1), with errno
set to EINTR.
- If we don't handle these cases properly, we will either think we had
a "real" error and abort the program, or we will not handle the
premature awakening at all and start having a negative time-drift
(or, time flowing faster then it should).
Originally written by
guy keren