EINTR and PC Loser-Ing: The “Worse Is Better” Case Study (2011)
It’s true that invoking the system routine is a single instruction, but why is it that “the PC of the user program does not adequately capture the state of the process,” as Gabriel’s essay states? If we look closely at the “Worse is Better” essay, we get a strong clue about what the Unix guy in the story might have been talking about:
As someone who has done a lot of Unix system-level programming, this sounds to me like it must be describing EINTR, the error code in Unix that means “Interrupted system call.” To give a quick description of EINTR I’ll enlist the help of my trusty copy of “Advanced Programming in the Unix Environment” by W. Richard Stevens:
This sounds an awful lot like the the New Jersey guy’s approach from the story, which required a correct program “to check the error code to determine whether to simply try the system routine again.”
Source: blog.reverberate.org