diff --git a/lib/std/child_process.zig b/lib/std/child_process.zig index e1c489bf0..1bd0becfd 100644 --- a/lib/std/child_process.zig +++ b/lib/std/child_process.zig @@ -357,6 +357,7 @@ pub const ChildProcess = struct { error.NoSpaceLeft => unreachable, error.FileTooBig => unreachable, error.DeviceBusy => unreachable, + error.FileLocksNotSupported => unreachable, else => |e| return e, } else diff --git a/lib/std/fs.zig b/lib/std/fs.zig index ccfe54c5c..f64bd6156 100644 --- a/lib/std/fs.zig +++ b/lib/std/fs.zig @@ -843,6 +843,7 @@ pub const Dir = struct { error.IsDir => unreachable, // we're providing O_DIRECTORY error.NoSpaceLeft => unreachable, // not providing O_CREAT error.PathAlreadyExists => unreachable, // not providing O_CREAT + error.FileLocksNotSupported => unreachable, // locking folders is not supported else => |e| return e, }; return Dir{ .fd = fd }; diff --git a/lib/std/os.zig b/lib/std/os.zig index aa302490d..e0e998a4a 100644 --- a/lib/std/os.zig +++ b/lib/std/os.zig @@ -819,26 +819,34 @@ pub const OpenError = error{ SystemFdQuotaExceeded, NoDevice, FileNotFound, + /// The path exceeded `MAX_PATH_BYTES` bytes. NameTooLong, + /// Insufficient kernel memory was available, or /// the named file is a FIFO and per-user hard limit on /// memory allocation for pipes has been reached. SystemResources, + /// The file is too large to be opened. This error is unreachable /// for 64-bit targets, as well as when opening directories. FileTooBig, + /// The path refers to directory but the `O_DIRECTORY` flag was not provided. IsDir, + /// A new path cannot be created because the device has no room for the new file. /// This error is only reachable when the `O_CREAT` flag is provided. NoSpaceLeft, + /// A component used as a directory in the path was not, in fact, a directory, or /// `O_DIRECTORY` was specified and the path was not a directory. NotDir, + /// 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; diff --git a/lib/std/zig/system.zig b/lib/std/zig/system.zig index 2ce7b406a..f6a45860b 100644 --- a/lib/std/zig/system.zig +++ b/lib/std/zig/system.zig @@ -468,9 +468,8 @@ pub const NativeTargetInfo = struct { error.InvalidUtf8 => unreachable, error.BadPathName => unreachable, error.PipeBusy => unreachable, - error.PermissionDenied => unreachable, - error.FileBusy => unreachable, - error.Locked => unreachable, + error.FileLocksNotSupported => unreachable, + error.WouldBlock => unreachable, error.IsDir, error.NotDir, diff --git a/src-self-hosted/stage2.zig b/src-self-hosted/stage2.zig index 802493b7c..2ea414106 100644 --- a/src-self-hosted/stage2.zig +++ b/src-self-hosted/stage2.zig @@ -115,7 +115,6 @@ const Error = extern enum { InvalidOperatingSystemVersion, UnknownClangOption, NestedResponseFile, - PermissionDenied, FileBusy, Locked, }; @@ -849,9 +848,7 @@ export fn stage2_libc_parse(stage1_libc: *Stage2LibCInstallation, libc_file_z: [ error.NoDevice => return .NoDevice, error.NotDir => return .NotDir, error.DeviceBusy => return .DeviceBusy, - error.PermissionDenied => return .PermissionDenied, - error.FileBusy => return .FileBusy, - error.Locked => return .Locked, + error.FileLocksNotSupported => unreachable, }; stage1_libc.initFromStage2(libc); return .None; diff --git a/src/error.cpp b/src/error.cpp index 1ad9589a1..03597686b 100644 --- a/src/error.cpp +++ b/src/error.cpp @@ -85,7 +85,6 @@ const char *err_str(Error err) { case ErrorInvalidOperatingSystemVersion: return "invalid operating system version"; case ErrorUnknownClangOption: return "unknown Clang option"; case ErrorNestedResponseFile: return "nested response file"; - case ErrorPermissionDenied: return "permission is denied"; case ErrorFileBusy: return "file is busy"; case ErrorLocked: return "file is locked by another process"; } diff --git a/src/stage2.h b/src/stage2.h index 76b6683ba..0e5b28b0e 100644 --- a/src/stage2.h +++ b/src/stage2.h @@ -107,7 +107,6 @@ enum Error { ErrorInvalidOperatingSystemVersion, ErrorUnknownClangOption, ErrorNestedResponseFile, - ErrorPermissionDenied, ErrorFileBusy, ErrorLocked, };