diff options
| author | LeRoyce Pearson <leroycepearson@geemili.xyz> | 2020-03-12 21:19:25 -0600 |
|---|---|---|
| committer | LeRoyce Pearson <leroycepearson@geemili.xyz> | 2020-03-14 10:12:46 -0600 |
| commit | 43ccc2d81ec4c95c04dad9684f8b24633baab33e (patch) | |
| tree | a8a75b9c652f52ddef9be2d4c54390bfcc4ed760 /lib/std/fs | |
| parent | 43c4faba5516bed725cd058ced6f1a53e166c6af (diff) | |
| download | zig-43ccc2d81ec4c95c04dad9684f8b24633baab33e.tar.gz zig-43ccc2d81ec4c95c04dad9684f8b24633baab33e.zip | |
Add note about mandatory locks on linux
Diffstat (limited to 'lib/std/fs')
| -rw-r--r-- | lib/std/fs/file.zig | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/std/fs/file.zig b/lib/std/fs/file.zig index ee12432496..d34c6141d9 100644 --- a/lib/std/fs/file.zig +++ b/lib/std/fs/file.zig @@ -46,8 +46,11 @@ pub const File = struct { /// the file is opened with a shared lock, allowing the other processes to read from the /// file, but not to write to the file. /// - /// Note that the lock is only advisory on Linux. This means that a process that does not - /// respect the locking API can still read and write to the file, despite the lock. + /// Note that the lock is only advisory on Linux, except in very specific cirsumstances[1]. + /// This means that a process that does not respect the locking API can still read and write + /// to the file, despite the lock. + /// + /// [1]: https://www.kernel.org/doc/Documentation/filesystems/mandatory-locking.txt lock: bool = false, /// This prevents `O_NONBLOCK` from being passed even if `std.io.is_async`. @@ -71,8 +74,11 @@ pub const File = struct { /// Prevent other files from accessing this file while this process has it is open. /// - /// Note that the lock is only advisory on Linux. This means that a process that does not - /// respect the locking API can still read and write to the file, despite the lock. + /// Note that the lock is only advisory on Linux, except in very specific cirsumstances[1]. + /// This means that a process that does not respect the locking API can still read and write + /// to the file, despite the lock. + /// + /// [1]: https://www.kernel.org/doc/Documentation/filesystems/mandatory-locking.txt lock: bool = false, /// For POSIX systems this is the file system mode the file will |
