: As per posix, linux returns -1 and sets errno to be EAGAIN. Originally,
: linux had separate EAGAIN and EWOULDBLOCK, but to simplify porting of
: bsd software (especially networking code), EWOULDBLOCK is now defined to
: be the same as EAGAIN, so if you recompile any bsd sources with the new
: header files, the posix behaviour actually looks like BSD ("new header
: files" means that you have to have a new version of linux (0.99+) and
: have the headers correctly symlinked)
The problem with this is, if you have SVR3 code lying around (which is the majority of my source code), you have to check the return value from the read AND
errno. If errno == EAGAIN, retry the read (possibly sleeping or doing a
select() so you don't lock the processor into a hard loop).
What is the most efficient way of doing this? I've been bitten by this one
several times. cu also had this bug until I worked up a patch for it, too.
--
Ed Carp erc@apple.com, erc@saturn.upl.com 801/538-0177
1935 will go down in history. For the first time, a civilized nation has
full gun registration. Our streets will be safer, our police more efficient,
and the world will follow our lead into the future. --Adolf Hitler