diff options
| author | Alejandro Colomar <alx@kernel.org> | 2023-03-17 17:08:01 +0100 |
|---|---|---|
| committer | Alejandro Colomar <alx@kernel.org> | 2023-03-30 15:14:55 +0200 |
| commit | 4131356cdab8d37fc395ca5466a0401c8573380c (patch) | |
| tree | 8c4c6f1c3172358b735b481cbbfdd9cc04b00ed9 /man2/flock.2 | |
| parent | fd00f831b52d61a91d59cb3b46182869145d9700 (diff) | |
| download | man-pages-4131356cdab8.tar.gz | |
man*/, man-pages.7: VERSIONS, STANDARDS, HISTORY: Reorganize sections
- Add a new HISTORY section that covers the history of an API, both
regarding implementations and regarding old standards. This was
previously covered in VERSIONS, and in some cases in STANDARDS.
- Repurpose VERSIONS to cover differing implementations in _current_
systems.
- STANDARDS is reduced to only cover current versions of standards.
That basically means only C11 (C99 has been superseeded by C11; C17
is just a bugfix of C11, so not really a new version), and
POSIX.1-2008 (*-2001 was superseeded by *-2008; *-2017 was just a
bugfix for *-2008). The section also mentions for example 'Linux',
'GNU' or 'BSD' when a non-standard API is Linux- or GNU-only or if
it's (de-facto) standard in the BSDs.
- In some cases content that should go into one of these sections was
in NOTES. Move it from there to where it corresponds.
- In the SYNOPSIS, I added [[deprecated]] in some functions that I
found are deprecated by the relevant standards.
- A few other related changes...
Cc: Oskari Pirhonen <xxc3ncoredxx@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Diffstat (limited to 'man2/flock.2')
| -rw-r--r-- | man2/flock.2 | 114 |
1 files changed, 58 insertions, 56 deletions
diff --git a/man2/flock.2 b/man2/flock.2 index 42fc1c5952..a136bcfe8d 100644 --- a/man2/flock.2 +++ b/man2/flock.2 @@ -121,16 +121,7 @@ The kernel ran out of memory for allocating lock records. The file is locked and the .B LOCK_NB flag was selected. -.SH STANDARDS -4.4BSD (the -.BR flock () -call first appeared in 4.2BSD). -A version of -.BR flock (), -possibly implemented in terms of -.BR fcntl (2), -appears on most UNIX systems. -.SH NOTES +.SH VERSIONS Since Linux 2.0, .BR flock () is implemented as a system call in its own right rather @@ -153,38 +144,43 @@ and locks .I do interact with one another.) -.PP -.BR flock () -places advisory locks only; given suitable permissions on a file, -a process is free to ignore the use of +.SS CIFS details +Up to Linux 5.4, .BR flock () -and perform I/O on the file. +is not propagated over SMB. +A file with such locks will not appear locked for remote clients. .PP +Since Linux 5.5, .BR flock () -and +locks are emulated with SMB byte-range locks on the entire file. +Similarly to NFS, this means that .BR fcntl (2) -locks have different semantics with respect to forked processes and -.BR dup (2). -On systems that implement -.BR flock () -using -.BR fcntl (2), -the semantics of +and .BR flock () -will be different from those described in this manual page. +locks interact with one another. +Another important side-effect is that the locks are not advisory anymore: +any IO on a locked file will always fail with +.B EACCES +when done from a separate file descriptor. +This difference originates from the design of locks in the SMB protocol, +which provides mandatory locking semantics. .PP -Converting a lock -(shared to exclusive, or vice versa) is not guaranteed to be atomic: -the existing lock is first removed, and then a new lock is established. -Between these two steps, -a pending lock request by another process may be granted, -with the result that the conversion either blocks, or fails if -.B LOCK_NB -was specified. -(This is the original BSD behavior, -and occurs on many other implementations.) -.\" Kernel 2.5.21 changed things a little: during lock conversion -.\" it is now the highest priority process that will get the lock -- mtk +Remote and mandatory locking semantics may vary with +SMB protocol, mount options and server type. +See +.BR mount.cifs (8) +for additional information. +.SH STANDARDS +BSD. +.SH HISTORY +4.4BSD (the +.BR flock () +call first appeared in 4.2BSD). +A version of +.BR flock (), +possibly implemented in terms of +.BR fcntl (2), +appears on most UNIX systems. .SS NFS details Up to Linux 2.6.11, .BR flock () @@ -222,32 +218,38 @@ see the discussion of the .I "local_lock" option in .BR nfs (5). -.SS CIFS details -Up to Linux 5.4, +.SH NOTES .BR flock () -is not propagated over SMB. -A file with such locks will not appear locked for remote clients. +places advisory locks only; given suitable permissions on a file, +a process is free to ignore the use of +.BR flock () +and perform I/O on the file. .PP -Since Linux 5.5, .BR flock () -locks are emulated with SMB byte-range locks on the entire file. -Similarly to NFS, this means that -.BR fcntl (2) and +.BR fcntl (2) +locks have different semantics with respect to forked processes and +.BR dup (2). +On systems that implement .BR flock () -locks interact with one another. -Another important side-effect is that the locks are not advisory anymore: -any IO on a locked file will always fail with -.B EACCES -when done from a separate file descriptor. -This difference originates from the design of locks in the SMB protocol, -which provides mandatory locking semantics. +using +.BR fcntl (2), +the semantics of +.BR flock () +will be different from those described in this manual page. .PP -Remote and mandatory locking semantics may vary with -SMB protocol, mount options and server type. -See -.BR mount.cifs (8) -for additional information. +Converting a lock +(shared to exclusive, or vice versa) is not guaranteed to be atomic: +the existing lock is first removed, and then a new lock is established. +Between these two steps, +a pending lock request by another process may be granted, +with the result that the conversion either blocks, or fails if +.B LOCK_NB +was specified. +(This is the original BSD behavior, +and occurs on many other implementations.) +.\" Kernel 2.5.21 changed things a little: during lock conversion +.\" it is now the highest priority process that will get the lock -- mtk .SH SEE ALSO .BR flock (1), .BR close (2), |
