summaryrefslogtreecommitdiffstats
path: root/lib/libc/sys/accept.2
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>1996-01-22 00:02:33 +0000
committerjulian <julian@FreeBSD.org>1996-01-22 00:02:33 +0000
commit619b731f5bb5e09dcf1eaf1fbd96383ca64398fd (patch)
treea89c7f50ec371cef4418259b9dccdd31ebb2f61f /lib/libc/sys/accept.2
parent663b14fb2f3198fb0bfb62ae16b6b56c2a4dd055 (diff)
downloadFreeBSD-src-619b731f5bb5e09dcf1eaf1fbd96383ca64398fd.zip
FreeBSD-src-619b731f5bb5e09dcf1eaf1fbd96383ca64398fd.tar.gz
Reviewed by: julian and (hsu?)
Submitted by: John Birrel(L?) changes for threadsafe operations
Diffstat (limited to 'lib/libc/sys/accept.2')
-rw-r--r--lib/libc/sys/accept.225
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/libc/sys/accept.2 b/lib/libc/sys/accept.2
index d475e36..126000a 100644
--- a/lib/libc/sys/accept.2
+++ b/lib/libc/sys/accept.2
@@ -129,6 +129,31 @@ by issuing a
call with providing only the control information,
or by calling
.Xr setsockopt 2 .
+.Sh IMPLEMENTATION NOTES
+.Pp
+In the non-threaded library
+.Fn accept
+is implemented as the
+.Va accept
+syscall.
+.Pp
+In the threaded library, the
+.Va accept
+syscall is assembled to
+.Fn _thread_sys_accept
+and
+.Fn accept
+is implemented as a function which locks
+.Va s
+for read and write, then calls
+.Fn _thread_sys_accept .
+If the call to
+.Fn _thread_sys_accept
+would block, a context switch is performed. Before returning,
+.Fn accept
+unlocks
+.Va s .
+.Pp
.Sh RETURN VALUES
The call returns \-1 on error. If it succeeds, it returns a non-negative
integer that is a descriptor for the accepted socket.
OpenPOWER on IntegriCloud