]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
close.2: Warn more clearly about the risks of close(2) and record locks
authorTomáš Golembiovský <tgolembi@redhat.com>
Tue, 22 Aug 2023 15:20:25 +0000 (17:20 +0200)
committerAlejandro Colomar <alx@kernel.org>
Fri, 25 Aug 2023 18:21:51 +0000 (20:21 +0200)
The consequences of using close(2) together with advisory record locks
are quite serious.  Make the warning more explicit.

Signed-off-by: Tomáš Golembiovský <tgolembi@redhat.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
man2/close.2

index 68211bc58c17ffaedbdb966b9b43064f1f06a20a..f8a4ccc2d740dbd8c45fdec687091c7c94804246 100644 (file)
@@ -32,8 +32,14 @@ may be reused.
 Any record locks (see
 .BR fcntl (2))
 held on the file it was associated with,
-and owned by the process, are removed (regardless of the file
-descriptor that was used to obtain the lock).
+and owned by the process,
+are removed regardless of the file descriptor that was used to obtain the lock.
+This has some unfortunate consequences
+and one should be extra careful when using advisory record locking.
+See
+.BR fcntl (2)
+for discussion of the risks and consequences
+as well as for the (probably preferred) open file description locks.
 .PP
 If
 .I fd