[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sat, 02 Mar 2013 19:53:47 -0800
From: "H. Peter Anvin" <hpa@...or.com>
To: Ulrich Drepper <drepper@...il.com>
CC: Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Al Viro <viro@...iv.linux.org.uk>
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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists