diff --git a/lib/std/child_process.zig b/lib/std/child_process.zig index e1c489bf059901841f14fd76a766046fc3a36d95..1bd0becfd057c1da21e648afd05557d7f13976c0 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 ccfe54c5c462c3912bbc97806d4f6dbcbf4ae7d4..f64bd61569d644dda373ce91a2a6c82f88a4dc59 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 aa302490d0eb6f455d45b6458149444226be31e6..e0e998a4a6a8183e05fd5e2e2ca20344afe13b08 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 2ce7b406a4153158c32255eaa4ff4430e59201d8..f6a45860be37a615fd6d8f00326de08164c885df 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 802493b7c017b036761bf768a6e20f41674b1fb5..2ea414106cc1165376942f8439fb1eca80ebaf02 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 1ad9589a14e6b77085c1bda10bda0b8f87a8b89c..03597686b8c0b8d9b39ab8962054dbe221303335 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 76b6683ba3ad05b9e0108ea99fc40cc43ac2d156..0e5b28b0e86bbc0708d86c1161f95ee58f6b92c9 100644 --- a/src/stage2.h +++ b/src/stage2.h @@ -107,7 +107,6 @@ enum Error { ErrorInvalidOperatingSystemVersion, ErrorUnknownClangOption, ErrorNestedResponseFile, - ErrorPermissionDenied, ErrorFileBusy, ErrorLocked, };