From 75331fe5be2c94da9c5ef4db51ded9f039f78410 Mon Sep 17 00:00:00 2001 From: yar Date: Mon, 17 May 2004 23:09:10 +0000 Subject: 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 --- lib/libc/gen/lockf.3 | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'lib/libc/gen/lockf.3') diff --git a/lib/libc/gen/lockf.3 b/lib/libc/gen/lockf.3 index abb00ac..63cf669 100644 --- a/lib/libc/gen/lockf.3 +++ b/lib/libc/gen/lockf.3 @@ -173,10 +173,22 @@ error. .Pp The .Fn lockf , -.Xr fcntl 2 +.Xr fcntl 2 , and .Xr flock 2 -locks may be safely used concurrently. +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 +.Xr fcntl 2 +or +.Fn lockf , +and vice versa. .Pp Blocking on a section is interrupted by any signal. .Sh RETURN VALUES -- cgit v1.1