| @@ -1,8 +1,13 @@ |
| 1 | | − Mandatory File Locking For The Linux Operating System |
| 1 | +.. SPDX-License-Identifier: GPL-2.0 |
| 2 | + |
| 3 | +===================================================== |
| 4 | +Mandatory File Locking For The Linux Operating System |
| 5 | +===================================================== |
| 2 | 6 | |
| 3 | 7 | Andy Walker <andy@lysaker.kvaerner.no> |
| 4 | 8 | |
| 5 | 9 | 15 April 1996 |
| 10 | + |
| 6 | 11 | (Updated September 2007) |
| 7 | 12 | |
| 8 | 13 | 0. Why you should avoid mandatory locking |
| @@ -53,15 +58,17 @@ possible on existing user code. The scheme is based on marking individual files · 44 unmodified lines |
| 53 | 58 | as candidates for mandatory locking, and using the existing fcntl()/lockf() |
| 54 | 59 | interface for applying locks just as if they were normal, advisory locks. |
| 55 | 60 | |
| 56 | | −Note 1: In saying "file" in the paragraphs above I am actually not telling |
| 57 | | −the whole truth. System V locking is based on fcntl(). The granularity of |
| 58 | | −fcntl() is such that it allows the locking of byte ranges in files, in addition |
| 59 | | −to entire files, so the mandatory locking rules also have byte level |
| 60 | | −granularity. |
| 61 | +.. Note:: |
| 62 | + |
| 63 | + 1. In saying "file" in the paragraphs above I am actually not telling |
| 64 | + the whole truth. System V locking is based on fcntl(). The granularity of |
| 65 | + fcntl() is such that it allows the locking of byte ranges in files, in |
| 66 | + addition to entire files, so the mandatory locking rules also have byte |
| 67 | + level granularity. |
| 61 | 68 | |
| 62 | | −Note 2: POSIX.1 does not specify any scheme for mandatory locking, despite |
| 63 | | −borrowing the fcntl() locking scheme from System V. The mandatory locking |
| 64 | | −scheme is defined by the System V Interface Definition (SVID) Version 3. |
| 69 | + 2. POSIX.1 does not specify any scheme for mandatory locking, despite |
| 70 | + borrowing the fcntl() locking scheme from System V. The mandatory locking |
| 71 | + scheme is defined by the System V Interface Definition (SVID) Version 3. |
| 65 | 72 | |
| 66 | 73 | 2. Marking a file for mandatory locking |
| 67 | 74 | --------------------------------------- |