| author | |
| committer | |
| log | b96882c57a20d3f9f19640dbb6b2483d7dea5dfe |
| tree | 344bd41f00e1025b1f5dd9e8f69f3bbc8926d8ff |
| parent | bf8bf528c6c131f61de4af24c3599486a59c5868 |
5 files changed, 13 insertions(+), 6 deletions(-)
lib/std/child_process.zig+1| ... | ... | @@ -364,6 +364,7 @@ pub const ChildProcess = struct { |
| 364 | 364 | error.FileTooBig => unreachable, |
| 365 | 365 | error.DeviceBusy => unreachable, |
| 366 | 366 | error.FileLocksNotSupported => unreachable, |
| 367 | error.NotCapable => unreachable, // until WASI comes up with multi-processing (if ever) | |
| 367 | 368 | else => |e| return e, |
| 368 | 369 | } |
| 369 | 370 | else |
lib/std/elf.zig+1| ... | ... | @@ -551,6 +551,7 @@ fn preadNoEof(file: std.fs.File, buf: []u8, offset: u64) !void { |
| 551 | 551 | error.InputOutput => return error.FileSystem, |
| 552 | 552 | error.Unexpected => return error.Unexpected, |
| 553 | 553 | error.WouldBlock => return error.Unexpected, |
| 554 | error.NotCapable => unreachable, // NotCapable mainly pertains WASI target so it's a bug if we hit it here | |
| 554 | 555 | }; |
| 555 | 556 | if (len == 0) return error.UnexpectedEndOfFile; |
| 556 | 557 | i += len; |
lib/std/fs.zig+2| ... | ... | @@ -1272,6 +1272,7 @@ pub const Dir = struct { |
| 1272 | 1272 | if (self.deleteFile(sub_path)) { |
| 1273 | 1273 | return; |
| 1274 | 1274 | } else |err| switch (err) { |
| 1275 | error.DirNotEmpty => unreachable, | |
| 1275 | 1276 | error.FileNotFound => return, |
| 1276 | 1277 | error.IsDir => {}, |
| 1277 | 1278 | error.AccessDenied => got_access_denied = true, |
| ... | ... | @@ -1341,6 +1342,7 @@ pub const Dir = struct { |
| 1341 | 1342 | |
| 1342 | 1343 | // Impossible because we do not pass any path separators. |
| 1343 | 1344 | error.NotDir => unreachable, |
| 1345 | error.DirNotEmpty => unreachable, | |
| 1344 | 1346 | |
| 1345 | 1347 | error.IsDir => {}, |
| 1346 | 1348 | error.AccessDenied => got_access_denied = true, |
lib/std/os.zig+6-6| ... | ... | @@ -1589,11 +1589,11 @@ pub fn symlinkZ(target_path: [*:0]const u8, sym_link_path: [*:0]const u8) SymLin |
| 1589 | 1589 | } |
| 1590 | 1590 | } |
| 1591 | 1591 | |
| 1592 | pub const SymlinkatError = error{ | |
| 1592 | pub const SymLinkAtError = error{ | |
| 1593 | 1593 | /// WASI-only. This error occurs when the file descriptor does |
| 1594 | 1594 | /// not hold the required rights to create a new symbolic link relative to it. |
| 1595 | 1595 | NotCapable, |
| 1596 | } || SymlinkError; | |
| 1596 | } || SymLinkError; | |
| 1597 | 1597 | |
| 1598 | 1598 | /// Similar to `symlink`, however, creates a symbolic link named `sym_link_path` which contains the string |
| 1599 | 1599 | /// `target_path` **relative** to `newdirfd` directory handle. |
| ... | ... | @@ -1601,7 +1601,7 @@ pub const SymlinkatError = error{ |
| 1601 | 1601 | /// one; the latter case is known as a dangling link. |
| 1602 | 1602 | /// If `sym_link_path` exists, it will not be overwritten. |
| 1603 | 1603 | /// See also `symlinkatWasi`, `symlinkatZ` and `symlinkatW`. |
| 1604 | pub fn symlinkat(target_path: []const u8, newdirfd: fd_t, sym_link_path: []const u8) SymLinkatError!void { | |
| 1604 | pub fn symlinkat(target_path: []const u8, newdirfd: fd_t, sym_link_path: []const u8) SymLinkAtError!void { | |
| 1605 | 1605 | if (builtin.os.tag == .wasi) { |
| 1606 | 1606 | return symlinkatWasi(target_path, newdirfd, sym_link_path); |
| 1607 | 1607 | } |
| ... | ... | @@ -1619,7 +1619,7 @@ pub const symlinkatC = @compileError("deprecated: renamed to symlinkatZ"); |
| 1619 | 1619 | |
| 1620 | 1620 | /// WASI-only. The same as `symlinkat` but targeting WASI. |
| 1621 | 1621 | /// See also `symlinkat`. |
| 1622 | pub fn symlinkatWasi(target_path: []const u8, newdirfd: fd_t, sym_link_path: []const u8) SymLinkatError!void { | |
| 1622 | pub fn symlinkatWasi(target_path: []const u8, newdirfd: fd_t, sym_link_path: []const u8) SymLinkAtError!void { | |
| 1623 | 1623 | switch (wasi.path_symlink(target_path.ptr, target_path.len, newdirfd, sym_link_path.ptr, sym_link_path.len)) { |
| 1624 | 1624 | wasi.ESUCCESS => {}, |
| 1625 | 1625 | wasi.EFAULT => unreachable, |
| ... | ... | @@ -1643,13 +1643,13 @@ pub fn symlinkatWasi(target_path: []const u8, newdirfd: fd_t, sym_link_path: []c |
| 1643 | 1643 | |
| 1644 | 1644 | /// Windows-only. The same as `symlinkat` except the paths are null-terminated, WTF-16 encoded. |
| 1645 | 1645 | /// See also `symlinkat`. |
| 1646 | pub fn symlinkatW(target_path: [*:0]const u16, newdirfd: fd_t, sym_link_path: [*:0]const u16) SymlinkatError!void { | |
| 1646 | pub fn symlinkatW(target_path: [*:0]const u16, newdirfd: fd_t, sym_link_path: [*:0]const u16) SymLinkAtError!void { | |
| 1647 | 1647 | @compileError("TODO implement on Windows"); |
| 1648 | 1648 | } |
| 1649 | 1649 | |
| 1650 | 1650 | /// The same as `symlinkat` except the parameters are null-terminated pointers. |
| 1651 | 1651 | /// See also `symlinkat`. |
| 1652 | pub fn symlinkatZ(target_path: [*:0]const u8, newdirfd: fd_t, sym_link_path: [*:0]const u8) SymLinkatError!void { | |
| 1652 | pub fn symlinkatZ(target_path: [*:0]const u8, newdirfd: fd_t, sym_link_path: [*:0]const u8) SymLinkAtError!void { | |
| 1653 | 1653 | if (builtin.os.tag == .windows) { |
| 1654 | 1654 | const target_path_w = try windows.cStrToPrefixedFileW(target_path); |
| 1655 | 1655 | const sym_link_path_w = try windows.cStrToPrefixedFileW(sym_link_path); |
src-self-hosted/stage2.zig+3| ... | ... | @@ -163,6 +163,7 @@ export fn stage2_render_ast(tree: *ast.Tree, output_file: *FILE) Error { |
| 163 | 163 | error.OutOfMemory => return .OutOfMemory, |
| 164 | 164 | error.Unexpected => return .Unexpected, |
| 165 | 165 | error.InputOutput => return .FileSystem, |
| 166 | error.NotCapable => unreachable, // we should handle this when we're able to cross-compile Zig to WASI | |
| 166 | 167 | }; |
| 167 | 168 | return .None; |
| 168 | 169 | } |
| ... | ... | @@ -606,6 +607,7 @@ export fn stage2_libc_parse(stage1_libc: *Stage2LibCInstallation, libc_file_z: [ |
| 606 | 607 | error.NotDir => return .NotDir, |
| 607 | 608 | error.DeviceBusy => return .DeviceBusy, |
| 608 | 609 | error.FileLocksNotSupported => unreachable, |
| 610 | error.NotCapable => unreachable, // we should handle this when we're able to cross-compile Zig to WASI | |
| 609 | 611 | }; |
| 610 | 612 | stage1_libc.initFromStage2(libc); |
| 611 | 613 | return .None; |
| ... | ... | @@ -649,6 +651,7 @@ export fn stage2_libc_render(stage1_libc: *Stage2LibCInstallation, output_file: |
| 649 | 651 | error.AccessDenied => return .AccessDenied, |
| 650 | 652 | error.Unexpected => return .Unexpected, |
| 651 | 653 | error.InputOutput => return .FileSystem, |
| 654 | error.NotCapable => unreachable, // we should handle this when we're able to cross-compile Zig to WASI | |
| 652 | 655 | }; |
| 653 | 656 | return .None; |
| 654 | 657 | } |