Commit 6fb677c4f6

Shritesh Bhattarai <shritesh@shritesh.com>
2019-05-02 18:25:25
wasi: native os.abort
1 parent f8117a0
Changed files (1)
std
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) {}