wasi: native os.abort

master
Shritesh Bhattarai 2019-05-02 11:25:25 -05:00
parent f8117a0799
commit 6fb677c4f6
1 changed files with 7 additions and 1 deletions

View File

@ -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) {}