Quoting Frank Schmirler vdr@schmirler.de:
On Wed, 19 Jul 2006 14:20:26 +0200, Stefan Lucke wrote
But safe_read() has to be modified, as socket is non- blocking (oldflags |= O_NONBLOCK;), EAGAIN should be handled too:
Before safe_read() select() is called through file.Ready(). So EAGAIN should not occur with SVDRP. But of course you're right if safe_read() is intended to be called for nonblocking IO without prior select().
But select() on files with O_NONBLOCK is like a noop according to this:
http://man.linuxquestions.org/index.php?query=select&type=2%C2%A7ion=2
Three independent sets of descriptors are watched. Those listed in readfds will be watched to see if characters become available for read- ing (more precisely, to see if a read will not block - in particular, a file descriptor is also ready on end-of-file), those in writefds will be watched to see if a write will not block, and those in exceptfds will be watched for exceptions. On exit, the sets are modified in place to indicate which descriptors actually changed status.
as with O_NONBLOCK a read would never block :-) .
Stefan