authorgravatar for leroycepearson@geemili.xyzLeRoyce Pearson <leroycepearson@geemili.xyz> 2020-04-02 22:12:45-06:00
committergravatar for leroycepearson@geemili.xyzLeRoyce Pearson <leroycepearson@geemili.xyz> 2020-04-02 22:12:45-06:00
loge7cf3f92a98cd2bd94d9d94fb361819b6ab89e8d
tree0dd42974a28cec76c70e896f95d10890a6f182dd
parentf757f0ea59ba3f44377bb11248d4062ce6847e41

Add FileLocksNotSupported error to OpenError


1 files changed, 4 insertions(+), 0 deletions(-)

lib/std/os.zig+4
...@@ -846,6 +846,9 @@ pub const OpenError = error{...@@ -846,6 +846,9 @@ pub const OpenError = error{
846 /// The path already exists and the `O_CREAT` and `O_EXCL` flags were provided.846 /// The path already exists and the `O_CREAT` and `O_EXCL` flags were provided.
847 PathAlreadyExists,847 PathAlreadyExists,
848 DeviceBusy,848 DeviceBusy,
849
850 /// The underlying filesystem does not support file locks
851 FileLocksNotSupported
849} || UnexpectedError;852} || UnexpectedError;
850853
851/// Open and possibly create a file. Keeps trying if it gets interrupted.854/// 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)...@@ -931,6 +934,7 @@ pub fn openatZ(dir_fd: fd_t, file_path: [*:0]const u8, flags: u32, mode: mode_t)
931 EPERM => return error.AccessDenied,934 EPERM => return error.AccessDenied,
932 EEXIST => return error.PathAlreadyExists,935 EEXIST => return error.PathAlreadyExists,
933 EBUSY => return error.DeviceBusy,936 EBUSY => return error.DeviceBusy,
937 EOPNOTSUPP => return error.FileLocksNotSupported,
934 else => |err| return unexpectedErrno(err),938 else => |err| return unexpectedErrno(err),
935 }939 }
936 }940 }