This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: FreeBSD port (29): sendfile
- From: Roland McGrath <roland at redhat dot com>
- To: Bruno Haible <bruno at clisp dot org>
- Cc: libc-alpha at sources dot redhat dot com
- Date: Mon, 26 Aug 2002 03:04:41 -0700
- Subject: Re: FreeBSD port (29): sendfile
> 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.)