From: Tomáš Golembiovský Date: Tue, 22 Aug 2023 15:20:25 +0000 (+0200) Subject: close.2: Warn more clearly about the risks of close(2) and record locks X-Git-Tag: man-pages-6.06~310 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8f6f4e46ded4fc86b20719dbefcd0e936200626b;p=thirdparty%2Fman-pages.git close.2: Warn more clearly about the risks of close(2) and record locks The consequences of using close(2) together with advisory record locks are quite serious. Make the warning more explicit. Signed-off-by: Tomáš Golembiovský Signed-off-by: Alejandro Colomar --- diff --git a/man2/close.2 b/man2/close.2 index 68211bc58c..f8a4ccc2d7 100644 --- a/man2/close.2 +++ b/man2/close.2 @@ -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