authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2020-06-29 18:28:28+02:00
committergravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2020-06-29 21:42:11+02:00
log5bc99dd7e8c037aa6c5f46d779fba99163d1da36
treecf12826d1c78add8ba0a08309f8de74ef57f76b3
parentb96882c57a20d3f9f19640dbb6b2483d7dea5dfe

Fix more compilation errors


2 files changed, 5 insertions(+), 0 deletions(-)

lib/std/os.zig+1
...@@ -4012,6 +4012,7 @@ pub fn realpathZ(pathname: [*:0]const u8, out_buffer: *[MAX_PATH_BYTES]u8) RealP...@@ -4012,6 +4012,7 @@ pub fn realpathZ(pathname: [*:0]const u8, out_buffer: *[MAX_PATH_BYTES]u8) RealP
4012 if (builtin.os.tag == .linux and !builtin.link_libc) {4012 if (builtin.os.tag == .linux and !builtin.link_libc) {
4013 const fd = openZ(pathname, linux.O_PATH | linux.O_NONBLOCK | linux.O_CLOEXEC, 0) catch |err| switch (err) {4013 const fd = openZ(pathname, linux.O_PATH | linux.O_NONBLOCK | linux.O_CLOEXEC, 0) catch |err| switch (err) {
4014 error.FileLocksNotSupported => unreachable,4014 error.FileLocksNotSupported => unreachable,
4015 error.NotCapable => unreachable, // WASI only
4015 else => |e| return e,4016 else => |e| return e,
4016 };4017 };
4017 defer close(fd);4018 defer close(fd);
lib/std/zig/system.zig+4
...@@ -499,6 +499,7 @@ pub const NativeTargetInfo = struct {...@@ -499,6 +499,7 @@ pub const NativeTargetInfo = struct {
499 error.PipeBusy => unreachable,499 error.PipeBusy => unreachable,
500 error.FileLocksNotSupported => unreachable,500 error.FileLocksNotSupported => unreachable,
501 error.WouldBlock => unreachable,501 error.WouldBlock => unreachable,
502 error.NotCapable => unreachable, // we don't support WASI here (not yet at least)
502503
503 error.IsDir,504 error.IsDir,
504 error.NotDir,505 error.NotDir,
...@@ -790,6 +791,7 @@ pub const NativeTargetInfo = struct {...@@ -790,6 +791,7 @@ pub const NativeTargetInfo = struct {
790 var it = mem.tokenize(rpath_list, ":");791 var it = mem.tokenize(rpath_list, ":");
791 while (it.next()) |rpath| {792 while (it.next()) |rpath| {
792 var dir = fs.cwd().openDir(rpath, .{}) catch |err| switch (err) {793 var dir = fs.cwd().openDir(rpath, .{}) catch |err| switch (err) {
794 error.NotCapable => unreachable, // we don't support WASI here (not yet at least)
793 error.NameTooLong => unreachable,795 error.NameTooLong => unreachable,
794 error.InvalidUtf8 => unreachable,796 error.InvalidUtf8 => unreachable,
795 error.BadPathName => unreachable,797 error.BadPathName => unreachable,
...@@ -817,6 +819,7 @@ pub const NativeTargetInfo = struct {...@@ -817,6 +819,7 @@ pub const NativeTargetInfo = struct {
817 &link_buf,819 &link_buf,
818 ) catch |err| switch (err) {820 ) catch |err| switch (err) {
819 error.NameTooLong => unreachable,821 error.NameTooLong => unreachable,
822 error.NotCapable => unreachable, // we don't support WASI here (not yet at least)
820823
821 error.AccessDenied,824 error.AccessDenied,
822 error.FileNotFound,825 error.FileNotFound,
...@@ -851,6 +854,7 @@ pub const NativeTargetInfo = struct {...@@ -851,6 +854,7 @@ pub const NativeTargetInfo = struct {
851 const len = file.pread(buf[i .. buf.len - i], offset + i) catch |err| switch (err) {854 const len = file.pread(buf[i .. buf.len - i], offset + i) catch |err| switch (err) {
852 error.OperationAborted => unreachable, // Windows-only855 error.OperationAborted => unreachable, // Windows-only
853 error.WouldBlock => unreachable, // Did not request blocking mode856 error.WouldBlock => unreachable, // Did not request blocking mode
857 error.NotCapable => unreachable, // WASI only, and we don't support it here yet
854 error.SystemResources => return error.SystemResources,858 error.SystemResources => return error.SystemResources,
855 error.IsDir => return error.UnableToReadElfFile,859 error.IsDir => return error.UnableToReadElfFile,
856 error.BrokenPipe => return error.UnableToReadElfFile,860 error.BrokenPipe => return error.UnableToReadElfFile,