summaryrefslogtreecommitdiffstats
path: root/lib/libc/sys/sendfile.2
diff options
context:
space:
mode:
authorchris <chris@FreeBSD.org>2000-05-19 02:53:55 +0000
committerchris <chris@FreeBSD.org>2000-05-19 02:53:55 +0000
commit27ba376ce1a120fe1e1b7a6e77be80585c3ad5a0 (patch)
tree241a631cbe7d2c73735342de75080b725984c28d /lib/libc/sys/sendfile.2
parent7955e776a1d7141e969fa2a5e562833e37abfae1 (diff)
downloadFreeBSD-src-27ba376ce1a120fe1e1b7a6e77be80585c3ad5a0.zip
FreeBSD-src-27ba376ce1a120fe1e1b7a6e77be80585c3ad5a0.tar.gz
Add a note under IMPLEMENTATION NOTES about the behavior of sendfile()
in the threaded library.
Diffstat (limited to 'lib/libc/sys/sendfile.2')
-rw-r--r--lib/libc/sys/sendfile.227
1 files changed, 27 insertions, 0 deletions
diff --git a/lib/libc/sys/sendfile.2 b/lib/libc/sys/sendfile.2
index 878a3ad..1718872 100644
--- a/lib/libc/sys/sendfile.2
+++ b/lib/libc/sys/sendfile.2
@@ -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
OpenPOWER on IntegriCloud