Add a note under IMPLEMENTATION NOTES about the behavior of sendfile()

in the threaded library.
This commit is contained in:
Chris Costello 2000-05-19 02:53:55 +00:00
parent 76e61b9c71
commit ef626a01c1

View File

@ -103,6 +103,33 @@ is returned.
The FreeBSD implementation of
.Fn sendfile
is "zero-copy", meaning that it has been optimized so that copying of the file data is avoided.
.Pp
In the non-threaded library
.Fn sendfile
is implemented as the
.Va sendfile
syscall.
.Pp
In the threaded library, the
.Va sendfile
syscall is assembled to
.Fn _thread_sys_sendfile
and
.Fn sendfile
is implemented as a function which locks
.Fa fd
for reading and
.Fa s
for writing, then calls
.Fn _thread_sys_sendfile .
If the call to
.Fn _thread_sys_sendfile
would block, a context switch is performed. Before returning,
.Fn sendfile
unlocks
.Fa fd
and
.Fa s .
.Sh RETURN VALUES
Upon successful completion,
.Fn sendfile