◐ Shell
clean mode source ↗

Message 183832 - Python tracker

> Because otherwise sendfile() fails with EAGAIN many times before
> sending any actual data. 

EAGAIN on a blocking fd? Is it documented somewhere?
The Linux man page for sendfile() says:

       EAGAIN Nonblocking I/O has been selected using O_NONBLOCK and the
write would block.

FreeBSD apparently says something similar:

     [EAGAIN]		The socket is marked for non-blocking I/O and not all
			data was sent due to the socket buffer being filled.
			If specified, the number of bytes successfully sent
			will be returned in *sbytes.