diff options
| author | Shritesh Bhattarai <shritesh@shritesh.com> | 2019-05-02 11:25:25 -0500 |
|---|---|---|
| committer | Shritesh Bhattarai <shritesh@shritesh.com> | 2019-05-02 11:25:25 -0500 |
| commit | 6fb677c4f64920d0a6d0133f1ccd6f36564f4159 (patch) | |
| tree | d7f8d5e4ff64c2499534b5d5cfea1a7d245ce9b0 /std | |
| parent | f8117a0799f6c691bf65f3b3f4726bf0e6fd6be2 (diff) | |
| download | zig-6fb677c4f64920d0a6d0133f1ccd6f36564f4159.tar.gz zig-6fb677c4f64920d0a6d0133f1ccd6f36564f4159.zip | |
wasi: native os.abort
Diffstat (limited to 'std')
| -rw-r--r-- | std/os.zig | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/std/os.zig b/std/os.zig index 50904f7345..0912b7a2c5 100644 --- a/std/os.zig +++ b/std/os.zig @@ -200,7 +200,7 @@ pub fn abort() noreturn { c.abort(); } switch (builtin.os) { - Os.linux, Os.macosx, Os.ios, Os.freebsd, Os.netbsd, Os.wasi => { + Os.linux, Os.macosx, Os.ios, Os.freebsd, Os.netbsd => { _ = posix.raise(posix.SIGABRT); _ = posix.raise(posix.SIGKILL); while (true) {} @@ -211,6 +211,12 @@ pub fn abort() noreturn { } windows.ExitProcess(3); }, + Os.wasi => { + _ = wasi.proc_raise(wasi.SIGABRT); + // TODO: Is SIGKILL even necessary? + _ = wasi.proc_raise(wasi.SIGKILL); + while (true) {} + }, Os.uefi => { // TODO there's gotta be a better thing to do here than loop forever while (true) {} |
