Actually, sendfile(2) returns either 0 or -1 (with errno set). The
optional 'sbytes' argument indicates how many bytes were sent.
Maybe I wasn't clear in my original posting. If you use the optional
headers, then the *return value* from sendfile is non-zero, and is
*only * the amount sent via writev. Not 0, or -1 as the code and the
man page lead one to believe.
Garrett Wollman wrote:
>
> <<On Mon, 26 Feb 2001 17:06:05 -0600, Peter Lawthers <[EMAIL PROTECTED]> said:
>
> > When using sendfile(2) with the optional headers, it appears
> > that sendfile inadvertently returns the number of bytes written
> > via writev
>
> If any data was sent, sendfile() should tell you so.
>
> -GAWollman
>
> To Unsubscribe: send mail to [EMAIL PROTECTED]
> with "unsubscribe freebsd-net" in the body of the message
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-net" in the body of the message