| author | |
| committer | |
| log | 93528be6b19d608b4a02944e7e599554fc9f1378 |
| tree | 981a293b787470b46f5cf0ff015742e799fae4f1 |
| parent | fe9cd0b4bc9aaf108d4b226710fa3c83612b62e1 |
2 files changed, 11 insertions(+), 2 deletions(-)
std/os/wasi/core.zig+5| ... | ... | @@ -1,12 +1,17 @@ |
| 1 | 1 | pub const __wasi_errno_t = u16; |
| 2 | 2 | pub const __wasi_exitcode_t = u32; |
| 3 | 3 | pub const __wasi_fd_t = u32; |
| 4 | pub const __wasi_signal_t = u8; | |
| 4 | 5 | |
| 5 | 6 | pub const __wasi_ciovec_t = extern struct { |
| 6 | 7 | buf: [*]const u8, |
| 7 | 8 | buf_len: usize, |
| 8 | 9 | }; |
| 9 | 10 | |
| 11 | pub const __WASI_SIGABRT: __wasi_signal_t = 6; | |
| 12 | ||
| 13 | pub extern fn __wasi_proc_raise(sig: __wasi_signal_t) __wasi_errno_t; | |
| 14 | ||
| 10 | 15 | pub extern fn __wasi_proc_exit(rval: __wasi_exitcode_t) noreturn; |
| 11 | 16 | |
| 12 | 17 | pub extern fn __wasi_fd_write(fd: __wasi_fd_t, iovs: *const __wasi_ciovec_t, iovs_len: usize, nwritten: *usize) __wasi_errno_t; |
std/special/panic.zig+6-2| ... | ... | @@ -10,10 +10,14 @@ pub fn panic(msg: []const u8, error_return_trace: ?*builtin.StackTrace) noreturn |
| 10 | 10 | @setCold(true); |
| 11 | 11 | switch (builtin.os) { |
| 12 | 12 | // TODO: fix panic in zen |
| 13 | // TODO: fix panic in wasi | |
| 14 | builtin.Os.freestanding, builtin.Os.zen, builtin.Os.wasi => { | |
| 13 | builtin.Os.freestanding, builtin.Os.zen => { | |
| 15 | 14 | while (true) {} |
| 16 | 15 | }, |
| 16 | builtin.Os.wasi => { | |
| 17 | std.debug.warn("{}", msg); | |
| 18 | _ = std.os.wasi.__wasi_proc_raise(std.os.wasi.__WASI_SIGABRT); | |
| 19 | unreachable; | |
| 20 | }, | |
| 17 | 21 | builtin.Os.uefi => { |
| 18 | 22 | // TODO look into using the debug info and logging helpful messages |
| 19 | 23 | std.os.abort(); |