summaryrefslogtreecommitdiffstats
path: root/lib/libc/sys/close.2
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/sys/close.2')
-rw-r--r--lib/libc/sys/close.222
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/libc/sys/close.2 b/lib/libc/sys/close.2
index 885ac80..3cb3d51 100644
--- a/lib/libc/sys/close.2
+++ b/lib/libc/sys/close.2
@@ -90,6 +90,28 @@ execve; the call
.Dq Li fcntl(d, F_SETFD, 0)
restores the default,
which is to not close the descriptor.
+.Sh IMPLEMENTATION NOTES
+.Pp
+In the non-threaded library
+.Fn close
+is implemented as the
+.Va close
+syscall.
+.Pp
+In the threaded library, the
+.Va close
+syscall is assembled to
+.Fn _thread_sys_close
+and
+.Fn close
+is implemented as a function which locks
+.Va d
+for read and write, then calls
+.Fn _thread_sys_close .
+Before returning,
+.Fn close
+unlocks
+.Va d .
.Sh RETURN VALUES
Upon successful completion, a value of 0 is returned.
Otherwise, a value of -1 is returned and the global integer variable
OpenPOWER on IntegriCloud