aboutsummaryrefslogtreecommitdiff
path: root/lib/std/os.zig
diff options
context:
space:
mode:
authorLeRoyce Pearson <leroycepearson@geemili.xyz>2020-04-02 22:12:45 -0600
committerLeRoyce Pearson <leroycepearson@geemili.xyz>2020-04-02 22:12:45 -0600
commite7cf3f92a98cd2bd94d9d94fb361819b6ab89e8d (patch)
tree0dd42974a28cec76c70e896f95d10890a6f182dd /lib/std/os.zig
parentf757f0ea59ba3f44377bb11248d4062ce6847e41 (diff)
downloadzig-e7cf3f92a98cd2bd94d9d94fb361819b6ab89e8d.tar.gz
zig-e7cf3f92a98cd2bd94d9d94fb361819b6ab89e8d.zip
Add FileLocksNotSupported error to OpenError
Diffstat (limited to 'lib/std/os.zig')
-rw-r--r--lib/std/os.zig4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/std/os.zig b/lib/std/os.zig
index 49edda23ba..197857e61f 100644
--- a/lib/std/os.zig
+++ b/lib/std/os.zig
@@ -846,6 +846,9 @@ pub const OpenError = error{
/// The path already exists and the `O_CREAT` and `O_EXCL` flags were provided.
PathAlreadyExists,
DeviceBusy,
+
+ /// The underlying filesystem does not support file locks
+ FileLocksNotSupported
} || UnexpectedError;
/// Open and possibly create a file. Keeps trying if it gets interrupted.
@@ -931,6 +934,7 @@ pub fn openatZ(dir_fd: fd_t, file_path: [*:0]const u8, flags: u32, mode: mode_t)
EPERM => return error.AccessDenied,
EEXIST => return error.PathAlreadyExists,
EBUSY => return error.DeviceBusy,
+ EOPNOTSUPP => return error.FileLocksNotSupported,
else => |err| return unexpectedErrno(err),
}
}