mirror of https://github.com/mkerrisk/man-pages
Add warning that mandatory locking is unreliable.
This commit is contained in:
parent
a406395c86
commit
43ea35457d
15
man2/fcntl.2
15
man2/fcntl.2
|
@ -1016,18 +1016,19 @@ Despite this error return, the file descriptor owner is set,
|
|||
and signals will be sent to the owner.
|
||||
|
||||
The implementation of mandatory locking in all known versions of Linux
|
||||
is subject to races which render it unreliable: a
|
||||
is subject to races which render it unreliable:
|
||||
.\" http://marc.info/?l=linux-kernel&m=119013491707153&w=2
|
||||
a
|
||||
.BR write (2)
|
||||
call that overlaps with a lock may modify data after the mandatory lock is
|
||||
acquired,
|
||||
acquired;
|
||||
a
|
||||
.BR read (2)
|
||||
call that overlaps with a lock may detect changes to data that were made
|
||||
only after a write lock was acquired. Similar races exist between lock
|
||||
and
|
||||
.BR mmap (2)
|
||||
. It is therefore inadvisable to rely on mandatory locking.
|
||||
|
||||
only after a write lock was acquired.
|
||||
Similar races exist between mandatory locks and
|
||||
.BR mmap (2).
|
||||
It is therefore inadvisable to rely on mandatory locking.
|
||||
.SH "SEE ALSO"
|
||||
.BR dup2 (2),
|
||||
.BR flock (2),
|
||||
|
|
Loading…
Reference in New Issue