summaryrefslogtreecommitdiffstats
path: root/lib/libc/sys/getsockname.2
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/sys/getsockname.2')
-rw-r--r--lib/libc/sys/getsockname.222
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/libc/sys/getsockname.2 b/lib/libc/sys/getsockname.2
index d56e404..e053b47 100644
--- a/lib/libc/sys/getsockname.2
+++ b/lib/libc/sys/getsockname.2
@@ -51,6 +51,28 @@ the amount of space pointed to by
.Fa name .
On return it contains the actual size of the name
returned (in bytes).
+.Sh IMPLEMENTATION NOTES
+.Pp
+In the non-threaded library
+.Fn getsockname
+is implemented as the
+.Va getsockname
+syscall.
+.Pp
+In the threaded library, the
+.Va getsockname
+syscall is assembled to
+.Fn _thread_sys_getsockname
+and
+.Fn getsockname
+is implemented as a function which locks
+.Va fd
+for read and write, then calls
+.Fn _thread_sys_getsockname .
+Before returning,
+.Fn getsockname
+unlocks
+.Va fd .
.Sh DIAGNOSTICS
A 0 is returned if the call succeeds, -1 if it fails.
.Sh ERRORS
OpenPOWER on IntegriCloud