non-blocking IO EAGAIN on write

Nobody nobody at nowhere.com
Fri Jul 23 17:27:56 EDT 2010


On Fri, 23 Jul 2010 10:45:32 +0200, Thomas Guettler wrote:

> I use non-blocking io to check for timeouts. Sometimes I get EAGAIN
> (Resource temporarily unavailable) on write(). My working code looks
> like this. But I am unsure how many bytes have been written to the pipe
> if I get an EAGAIN IOError.

It should be zero; that's how the underlying system calls behave. If any
bytes are read/written, the number of bytes are returned. The call
only blocks (or fails with EAGAIN if non-blocking I/O is enabled) if it
isn't possible to read/write any data.




More information about the Python-list mailing list