mirror of
https://github.com/ziglang/zig.git
synced 2024-11-22 04:10:13 +00:00
Compare commits
4 Commits
6127506c87
...
f14b1733d7
Author | SHA1 | Date | |
---|---|---|---|
|
f14b1733d7 | ||
|
f845fa04a0 | ||
|
c9facf0ba3 | ||
|
43606ff3ec |
@ -48,7 +48,8 @@ fn read(ma: *MemoryAccessor, address: usize, buf: []u8) bool {
|
|||||||
switch (linux.E.init(bytes_read)) {
|
switch (linux.E.init(bytes_read)) {
|
||||||
.SUCCESS => return bytes_read == buf.len,
|
.SUCCESS => return bytes_read == buf.len,
|
||||||
.FAULT => return false,
|
.FAULT => return false,
|
||||||
.INVAL, .PERM, .SRCH => unreachable, // own pid is always valid
|
.INVAL, .SRCH => unreachable, // own pid is always valid
|
||||||
|
.PERM => {}, // Known to happen in containers.
|
||||||
.NOMEM => {},
|
.NOMEM => {},
|
||||||
.NOSYS => {}, // QEMU is known not to implement this syscall.
|
.NOSYS => {}, // QEMU is known not to implement this syscall.
|
||||||
else => unreachable, // unexpected
|
else => unreachable, // unexpected
|
||||||
|
@ -507,6 +507,7 @@ pub const SelfExePathError = error{
|
|||||||
DeviceBusy,
|
DeviceBusy,
|
||||||
SharingViolation,
|
SharingViolation,
|
||||||
PipeBusy,
|
PipeBusy,
|
||||||
|
PipeNotAvailable,
|
||||||
NotLink,
|
NotLink,
|
||||||
PathAlreadyExists,
|
PathAlreadyExists,
|
||||||
|
|
||||||
|
@ -39,6 +39,7 @@ pub const OpenError = error{
|
|||||||
FileNotFound,
|
FileNotFound,
|
||||||
AccessDenied,
|
AccessDenied,
|
||||||
PipeBusy,
|
PipeBusy,
|
||||||
|
PipeNotAvailable,
|
||||||
NameTooLong,
|
NameTooLong,
|
||||||
/// WASI-only; file paths must be valid UTF-8.
|
/// WASI-only; file paths must be valid UTF-8.
|
||||||
InvalidUtf8,
|
InvalidUtf8,
|
||||||
|
@ -37,6 +37,7 @@ pub const OpenError = error{
|
|||||||
NoDevice,
|
NoDevice,
|
||||||
AccessDenied,
|
AccessDenied,
|
||||||
PipeBusy,
|
PipeBusy,
|
||||||
|
PipeNotAvailable,
|
||||||
PathAlreadyExists,
|
PathAlreadyExists,
|
||||||
Unexpected,
|
Unexpected,
|
||||||
NameTooLong,
|
NameTooLong,
|
||||||
@ -132,6 +133,7 @@ pub fn OpenFile(sub_path_w: []const u16, options: OpenFileOptions) OpenError!HAN
|
|||||||
.SHARING_VIOLATION => return error.AccessDenied,
|
.SHARING_VIOLATION => return error.AccessDenied,
|
||||||
.ACCESS_DENIED => return error.AccessDenied,
|
.ACCESS_DENIED => return error.AccessDenied,
|
||||||
.PIPE_BUSY => return error.PipeBusy,
|
.PIPE_BUSY => return error.PipeBusy,
|
||||||
|
.PIPE_NOT_AVAILABLE => return error.PipeNotAvailable,
|
||||||
.OBJECT_PATH_SYNTAX_BAD => unreachable,
|
.OBJECT_PATH_SYNTAX_BAD => unreachable,
|
||||||
.OBJECT_NAME_COLLISION => return error.PathAlreadyExists,
|
.OBJECT_NAME_COLLISION => return error.PathAlreadyExists,
|
||||||
.FILE_IS_A_DIRECTORY => return error.IsDir,
|
.FILE_IS_A_DIRECTORY => return error.IsDir,
|
||||||
@ -801,6 +803,7 @@ pub fn CreateSymbolicLink(
|
|||||||
error.NotDir => return error.Unexpected,
|
error.NotDir => return error.Unexpected,
|
||||||
error.WouldBlock => return error.Unexpected,
|
error.WouldBlock => return error.Unexpected,
|
||||||
error.PipeBusy => return error.Unexpected,
|
error.PipeBusy => return error.Unexpected,
|
||||||
|
error.PipeNotAvailable => return error.Unexpected,
|
||||||
error.AntivirusInterference => return error.Unexpected,
|
error.AntivirusInterference => return error.Unexpected,
|
||||||
else => |e| return e,
|
else => |e| return e,
|
||||||
};
|
};
|
||||||
@ -1335,6 +1338,7 @@ pub fn GetFinalPathNameByHandle(
|
|||||||
error.NoDevice => return error.Unexpected,
|
error.NoDevice => return error.Unexpected,
|
||||||
error.AccessDenied => return error.Unexpected,
|
error.AccessDenied => return error.Unexpected,
|
||||||
error.PipeBusy => return error.Unexpected,
|
error.PipeBusy => return error.Unexpected,
|
||||||
|
error.PipeNotAvailable => return error.Unexpected,
|
||||||
error.PathAlreadyExists => return error.Unexpected,
|
error.PathAlreadyExists => return error.Unexpected,
|
||||||
error.WouldBlock => return error.Unexpected,
|
error.WouldBlock => return error.Unexpected,
|
||||||
error.NetworkNotFound => return error.Unexpected,
|
error.NetworkNotFound => return error.Unexpected,
|
||||||
|
@ -2574,6 +2574,7 @@ pub const RenameError = error{
|
|||||||
NoDevice,
|
NoDevice,
|
||||||
SharingViolation,
|
SharingViolation,
|
||||||
PipeBusy,
|
PipeBusy,
|
||||||
|
PipeNotAvailable,
|
||||||
/// On Windows, `\\server` or `\\server\share` was not found.
|
/// On Windows, `\\server` or `\\server\share` was not found.
|
||||||
NetworkNotFound,
|
NetworkNotFound,
|
||||||
/// On Windows, antivirus software is enabled by default. It can be
|
/// On Windows, antivirus software is enabled by default. It can be
|
||||||
@ -2945,6 +2946,7 @@ pub fn mkdiratW(dir_fd: fd_t, sub_path_w: []const u16, mode: u32) MakeDirError!v
|
|||||||
}) catch |err| switch (err) {
|
}) catch |err| switch (err) {
|
||||||
error.IsDir => return error.Unexpected,
|
error.IsDir => return error.Unexpected,
|
||||||
error.PipeBusy => return error.Unexpected,
|
error.PipeBusy => return error.Unexpected,
|
||||||
|
error.PipeNotAvailable => return error.Unexpected,
|
||||||
error.WouldBlock => return error.Unexpected,
|
error.WouldBlock => return error.Unexpected,
|
||||||
error.AntivirusInterference => return error.Unexpected,
|
error.AntivirusInterference => return error.Unexpected,
|
||||||
else => |e| return e,
|
else => |e| return e,
|
||||||
@ -3039,6 +3041,7 @@ pub fn mkdirW(dir_path_w: []const u16, mode: u32) MakeDirError!void {
|
|||||||
}) catch |err| switch (err) {
|
}) catch |err| switch (err) {
|
||||||
error.IsDir => return error.Unexpected,
|
error.IsDir => return error.Unexpected,
|
||||||
error.PipeBusy => return error.Unexpected,
|
error.PipeBusy => return error.Unexpected,
|
||||||
|
error.PipeNotAvailable => return error.Unexpected,
|
||||||
error.WouldBlock => return error.Unexpected,
|
error.WouldBlock => return error.Unexpected,
|
||||||
error.AntivirusInterference => return error.Unexpected,
|
error.AntivirusInterference => return error.Unexpected,
|
||||||
else => |e| return e,
|
else => |e| return e,
|
||||||
@ -5368,6 +5371,7 @@ pub const RealPathError = error{
|
|||||||
|
|
||||||
SharingViolation,
|
SharingViolation,
|
||||||
PipeBusy,
|
PipeBusy,
|
||||||
|
PipeNotAvailable,
|
||||||
|
|
||||||
/// Windows-only; file paths provided by the user must be valid WTF-8.
|
/// Windows-only; file paths provided by the user must be valid WTF-8.
|
||||||
/// https://simonsapin.github.io/wtf-8/
|
/// https://simonsapin.github.io/wtf-8/
|
||||||
|
@ -746,6 +746,7 @@ fn spawnWindows(self: *ChildProcess) SpawnError!void {
|
|||||||
}) catch |err| switch (err) {
|
}) catch |err| switch (err) {
|
||||||
error.PathAlreadyExists => return error.Unexpected, // not possible for "NUL"
|
error.PathAlreadyExists => return error.Unexpected, // not possible for "NUL"
|
||||||
error.PipeBusy => return error.Unexpected, // not possible for "NUL"
|
error.PipeBusy => return error.Unexpected, // not possible for "NUL"
|
||||||
|
error.PipeNotAvailable => return error.Unexpected, // not possible for "NUL"
|
||||||
error.FileNotFound => return error.Unexpected, // not possible for "NUL"
|
error.FileNotFound => return error.Unexpected, // not possible for "NUL"
|
||||||
error.AccessDenied => return error.Unexpected, // not possible for "NUL"
|
error.AccessDenied => return error.Unexpected, // not possible for "NUL"
|
||||||
error.NameTooLong => return error.Unexpected, // not possible for "NUL"
|
error.NameTooLong => return error.Unexpected, // not possible for "NUL"
|
||||||
|
@ -805,6 +805,7 @@ fn glibcVerFromRPath(rpath: []const u8) !std.SemanticVersion {
|
|||||||
error.InvalidWtf8 => unreachable, // Windows only
|
error.InvalidWtf8 => unreachable, // Windows only
|
||||||
error.BadPathName => unreachable, // Windows only
|
error.BadPathName => unreachable, // Windows only
|
||||||
error.PipeBusy => unreachable, // Windows-only
|
error.PipeBusy => unreachable, // Windows-only
|
||||||
|
error.PipeNotAvailable => unreachable, // Windows-only
|
||||||
error.SharingViolation => unreachable, // Windows-only
|
error.SharingViolation => unreachable, // Windows-only
|
||||||
error.NetworkNotFound => unreachable, // Windows-only
|
error.NetworkNotFound => unreachable, // Windows-only
|
||||||
error.AntivirusInterference => unreachable, // Windows-only
|
error.AntivirusInterference => unreachable, // Windows-only
|
||||||
@ -1068,6 +1069,7 @@ fn detectAbiAndDynamicLinker(
|
|||||||
error.InvalidWtf8 => unreachable, // Windows only
|
error.InvalidWtf8 => unreachable, // Windows only
|
||||||
error.BadPathName => unreachable,
|
error.BadPathName => unreachable,
|
||||||
error.PipeBusy => unreachable,
|
error.PipeBusy => unreachable,
|
||||||
|
error.PipeNotAvailable => unreachable,
|
||||||
error.FileLocksNotSupported => unreachable,
|
error.FileLocksNotSupported => unreachable,
|
||||||
error.WouldBlock => unreachable,
|
error.WouldBlock => unreachable,
|
||||||
error.FileBusy => unreachable, // opened without write permissions
|
error.FileBusy => unreachable, // opened without write permissions
|
||||||
|
@ -250,6 +250,7 @@ pub fn populateFile(comp: *Compilation, mod: *Module, file: *File) !void {
|
|||||||
error.BadPathName => unreachable, // it's always "builtin.zig"
|
error.BadPathName => unreachable, // it's always "builtin.zig"
|
||||||
error.NameTooLong => unreachable, // it's always "builtin.zig"
|
error.NameTooLong => unreachable, // it's always "builtin.zig"
|
||||||
error.PipeBusy => unreachable, // it's not a pipe
|
error.PipeBusy => unreachable, // it's not a pipe
|
||||||
|
error.PipeNotAvailable => unreachable, // it's not a pipe
|
||||||
error.WouldBlock => unreachable, // not asking for non-blocking I/O
|
error.WouldBlock => unreachable, // not asking for non-blocking I/O
|
||||||
|
|
||||||
error.FileNotFound => try writeFile(file, mod),
|
error.FileNotFound => try writeFile(file, mod),
|
||||||
|
@ -133,6 +133,7 @@ pub fn astGenFile(
|
|||||||
error.BadPathName => unreachable, // it's a hex encoded name
|
error.BadPathName => unreachable, // it's a hex encoded name
|
||||||
error.NameTooLong => unreachable, // it's a fixed size name
|
error.NameTooLong => unreachable, // it's a fixed size name
|
||||||
error.PipeBusy => unreachable, // it's not a pipe
|
error.PipeBusy => unreachable, // it's not a pipe
|
||||||
|
error.PipeNotAvailable => unreachable, // it's not a pipe
|
||||||
error.WouldBlock => unreachable, // not asking for non-blocking I/O
|
error.WouldBlock => unreachable, // not asking for non-blocking I/O
|
||||||
// There are no dir components, so you would think that this was
|
// There are no dir components, so you would think that this was
|
||||||
// unreachable, however we have observed on macOS two processes racing
|
// unreachable, however we have observed on macOS two processes racing
|
||||||
|
Loading…
Reference in New Issue
Block a user