This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: FreeBSD port (29): sendfile
- From: Christoph Hellwig <hch at lst dot de>
- To: Roland McGrath <roland at redhat dot com>
- Cc: Bruno Haible <bruno at clisp dot org>, libc-alpha at sources dot redhat dot com
- Date: Mon, 26 Aug 2002 16:11:37 +0200
- Subject: Re: FreeBSD port (29): sendfile
- References: <OF0F17C844.3D6B042E-ON85256C21.00457364-85256C21.0045D28C@mailrouter.net> <20020826152006.46ab021b.roger@opq.se> <3D6A32AB.C2461F38@caldera.com>
On Mon, Aug 26, 2002 at 03:04:41 -0700, Roland McGrath wrote:
> > Since FreeBSD's native sendfile() system call is not the same as the Linux
> > one (works only on sockets), here is a patch that adds an emulation of it
> > using read/write to sysdeps/posix/
>
> I don't think this is useful. sendfile is always an optimization, and any
> application needs to be prepared to fall back to other methods when it is
> not available. It may be entirely unavailable, or it may only work on
> certain types of file descriptors for the input and/or output, or have an
> unknown other set of constraints that make the system punt. If the system
> punts on the optimization, I think it is more useful for the lack of a
> useful sendfile to be reflected by having it fail so the application can
> fall back to other methods. (Perhaps it will use mmap or do something else
> entirely when it knows there is no specially-optimized solution available
As a small sidenote: In current Linux 2.5 sendfile() also works only
for sockets as output fd..