[PATCH] close.2: Warn more clearly about the risks of close(2) and record locks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 man2/close.2 | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/man2/close.2 b/man2/close.2
index 68211bc58..f8a4ccc2d 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
-- 
2.41.0




[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux