summaryrefslogtreecommitdiff
path: root/lib/libc/sys/read.2
diff options
context:
space:
mode:
authorJulian Elischer <julian@FreeBSD.org>1996-01-22 00:02:33 +0000
committerJulian Elischer <julian@FreeBSD.org>1996-01-22 00:02:33 +0000
commitf70177e76e605ec6e6cd5b938fa77ade5d380e87 (patch)
treea89c7f50ec371cef4418259b9dccdd31ebb2f61f /lib/libc/sys/read.2
parent61de51cad66df0d565233915f856932159d33a4a (diff)
Notes
Diffstat (limited to 'lib/libc/sys/read.2')
-rw-r--r--lib/libc/sys/read.247
1 files changed, 47 insertions, 0 deletions
diff --git a/lib/libc/sys/read.2 b/lib/libc/sys/read.2
index b94341a043c0e..ea428fd47a12b 100644
--- a/lib/libc/sys/read.2
+++ b/lib/libc/sys/read.2
@@ -107,6 +107,53 @@ The system guarantees to read the number of bytes requested if
the descriptor references a normal file that has that many bytes left
before the end-of-file, but in no other case.
.Pp
+.Sh IMPLEMENTATION NOTES
+.Pp
+In the non-threaded library
+.Fn read
+is implemented as the
+.Va read
+syscall.
+.Pp
+In the threaded library, the
+.Va read
+syscall is assembled to
+.Fn _thread_sys_read
+and
+.Fn read
+is implemented as a function which locks
+.Va d
+for read, then calls
+.Fn _thread_sys_read .
+If the call to
+.Fn _thread_sys_read
+would block, a context switch is performed. Before returning,
+.Fn read
+unlocks
+.Va d .
+.Pp
+In the non-threaded library
+.Fn readv
+is implemented as the
+.Va readv
+syscall.
+.Pp
+In the threaded library, the
+.Va readv
+syscall is assembled to
+.Fn _thread_sys_readv
+and
+.Fn readv
+is implemented as a function which locks
+.Va d
+for read, then calls
+.Fn _thread_sys_readv .
+If the call to
+.Fn _thread_sys_readv
+would block, a context switch is performed. Before returning,
+.Fn readv
+unlocks
+.Va d .
.Sh RETURN VALUES
If successful, the
number of bytes actually read is returned. Upon reading end-of-file,