> Because offsets can be negative
On Linux (and presumably on all POSIX platforms) passing a negative offset results in EINVAL.
> In that case, there's a problem with the patch, since select can block
> arbitrarily long because it doesn't take the socket timeout into
> account.
Right. I will fix that.
> Also, apparently socket.sendall() doesn't retry on EAGAIN,
> it doesn't use BEGIN_SELECT_LOOP.
socket.sendall() is not supposed to return EAGAIN in the first place. And again, I don't see how this is related with the issue at hand.
> I'm leaving this topic, you can do as you like...
Bye.