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 wr
When using sendfile(2) with the optional headers, it appears
that sendfile inadvertently returns the number of bytes written
via writev (writev updates p_retval[0]). I checked through the
archives, and it doesn't appear that I'm using sendfile(2) incorrectly,
although that's always a possibility.