authorgravatar for shritesh@shritesh.comShritesh Bhattarai <shritesh@shritesh.com> 2019-05-02 11:25:25-05:00
committergravatar for shritesh@shritesh.comShritesh Bhattarai <shritesh@shritesh.com> 2019-05-02 11:25:25-05:00
log6fb677c4f64920d0a6d0133f1ccd6f36564f4159
treed7f8d5e4ff64c2499534b5d5cfea1a7d245ce9b0
parentf8117a0799f6c691bf65f3b3f4726bf0e6fd6be2

wasi: native os.abort


1 files changed, 7 insertions(+), 1 deletions(-)

std/os.zig+7-1
......@@ -200,7 +200,7 @@ pub fn abort() noreturn {
200200 c.abort();
201201 }
202202 switch (builtin.os) {
203 Os.linux, Os.macosx, Os.ios, Os.freebsd, Os.netbsd, Os.wasi => {
203 Os.linux, Os.macosx, Os.ios, Os.freebsd, Os.netbsd => {
204204 _ = posix.raise(posix.SIGABRT);
205205 _ = posix.raise(posix.SIGKILL);
206206 while (true) {}
......@@ -211,6 +211,12 @@ pub fn abort() noreturn {
211211 }
212212 windows.ExitProcess(3);
213213 },
214 Os.wasi => {
215 _ = wasi.proc_raise(wasi.SIGABRT);
216 // TODO: Is SIGKILL even necessary?
217 _ = wasi.proc_raise(wasi.SIGKILL);
218 while (true) {}
219 },
214220 Os.uefi => {
215221 // TODO there's gotta be a better thing to do here than loop forever
216222 while (true) {}