Messages in this thread | | | Date | Sat, 02 Mar 2013 19:53:47 -0800 | From | "H. Peter Anvin" <> | Subject | Re: sendfile and EAGAIN |
| |
On 02/25/2013 09:22 AM, Ulrich Drepper wrote: > When using sendfile with a non-blocking output file descriptor for a > socket the operation can cause a partial write because of capacity > issues. This is nothing critical and the operation could resume after > the output queue is cleared. The problem is: there is no way to > determine where to resume. > > The system call just returns -EAGAIN without any further indication. > The caller doesn't know what to resend.
This is IMO just a bug. EAGAIN should only be used in the zero-byte case and in other cases it should return the number of bytes transferred, just like all the read/write system calls.
This was clearly also the intent.
-hpa
-- H. Peter Anvin, Intel Open Source Technology Center I work for Intel. I don't speak on their behalf.
| |