summaryrefslogtreecommitdiffstats
path: root/lib/libc/sys/fcntl.2
diff options
context:
space:
mode:
authoryar <yar@FreeBSD.org>2004-05-17 23:09:10 +0000
committeryar <yar@FreeBSD.org>2004-05-17 23:09:10 +0000
commit75331fe5be2c94da9c5ef4db51ded9f039f78410 (patch)
treec91b8ed3b77526e170afd00035d74d30b0184dd5 /lib/libc/sys/fcntl.2
parent7730ed4e269438738132eddf46a10fcec2e1a0f4 (diff)
downloadFreeBSD-src-75331fe5be2c94da9c5ef4db51ded9f039f78410.zip
FreeBSD-src-75331fe5be2c94da9c5ef4db51ded9f039f78410.tar.gz
Clarify and extend paragraphs on interoperation
of fcntl(2), flock(2), and lockf(3) advisory locks. Add such a paragraph to the flock(2) manpage for the sake of consistency. Reviewed by: Cyrille Lefevre and Kirk McKusick on -arch MFC after: 2 weeks
Diffstat (limited to 'lib/libc/sys/fcntl.2')
-rw-r--r--lib/libc/sys/fcntl.222
1 files changed, 19 insertions, 3 deletions
diff --git a/lib/libc/sys/fcntl.2 b/lib/libc/sys/fcntl.2
index c888890..92b7440 100644
--- a/lib/libc/sys/fcntl.2
+++ b/lib/libc/sys/fcntl.2
@@ -341,11 +341,26 @@ The
system call is recommended for applications that want to ensure the integrity
of their locks when using library routines or wish to pass locks
to their children.
-Note that
-.Xr flock 2
+.Pp
+The
+.Fn fcntl ,
+.Xr flock 2 ,
and
+.Xr lockf 3
+locks are compatible.
+Processes using different locking interfaces can cooperate
+over the same file safely.
+However, only one of such interfaces should be used within
+the same process.
+If a file is locked by a process through
+.Xr flock 2 ,
+any record within the file will be seen as locked
+from the viewpoint of another process using
.Fn fcntl
-locks may be safely used concurrently but
+or
+.Xr lockf 3 ,
+and vice versa.
+Note that
.Fn fcntl F_GETLK
returns \-1 in
.Fa l_pid
@@ -558,6 +573,7 @@ for the reasons as stated in
.Xr getdtablesize 2 ,
.Xr open 2 ,
.Xr sigvec 2 ,
+.Xr lockf 3 ,
.Xr tcgetpgrp 3 ,
.Xr tcsetpgrp 3
.Sh HISTORY
OpenPOWER on IntegriCloud