diff options
Diffstat (limited to 'lib/libc/sys/flock.2')
-rw-r--r-- | lib/libc/sys/flock.2 | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/libc/sys/flock.2 b/lib/libc/sys/flock.2 index bb6abb7..5ec080c 100644 --- a/lib/libc/sys/flock.2 +++ b/lib/libc/sys/flock.2 @@ -109,6 +109,28 @@ forks and the child explicitly unlocks the file, the parent will lose its lock. .Pp Processes blocked awaiting a lock may be awakened by signals. +.Sh IMPLEMENTATION NOTES +.Pp +In the non-threaded library +.Fn flock +is implemented as the +.Va flock +syscall. +.Pp +In the threaded library, the +.Va flock +syscall is assembled to +.Fn _thread_sys_flock +and +.Fn flock +is implemented as a function which locks +.Va fd +for read and write, then calls +.Fn _thread_sys_flock . +Before returning, +.Fn flock +unlocks +.Va fd . .Sh RETURN VALUES Zero is returned if the operation was successful; on an error a -1 is returned and an error code is left in |