FreeBSD port (29): sendfile

Bruno Haible haible@ilog.fr
Fri Jul 12 13:05:00 GMT 2002


James Antill writes:

> it's completely broken. If you pass NULL as the off_t
> then it's supposed to use the off_t associated with the fd (just like
> read and write) ...

That's what the submitted emulation does.

> your version will just silently drop data when
> reading from a non-file as the src.

No, if you call it on an fd not supporting lseek, and with
offset==NULL, the emulation will return -1 immediately. If, OTOH,
the fd supports lseek, then no data will be lost, due to the lseek()
call at the end.

Bruno



More information about the Libc-alpha mailing list