This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: FreeBSD port (29): sendfile


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..


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]