Date: Wed, 28 Feb 2001 09:29:51 -0600 From: Peter Lawthers <plawthers@chiaro.com> To: Garrett Wollman <wollman@khavrinen.lcs.mit.edu> Cc: freebsd-net@FreeBSD.ORG Subject: Re: sendfile with headers (struct sf_hdtr) Message-ID: <3A9D196F.49310D36@chiaro.com> References: <3A9AE15D.103DFBB7@chiaro.com> <200102270350.WAA71013@khavrinen.lcs.mit.edu>
next in thread | previous in thread | raw e-mail | index | archive | help
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 <plawthers@chiaro.com> 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 majordomo@FreeBSD.org > with "unsubscribe freebsd-net" in the body of the message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3A9D196F.49310D36>