| ... | @@ -200,7 +200,7 @@ pub fn abort() noreturn { | ... | @@ -200,7 +200,7 @@ pub fn abort() noreturn { |
| 200 | c.abort(); | 200 | c.abort(); |
| 201 | } | 201 | } |
| 202 | switch (builtin.os) { | 202 | 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 => { |
| 204 | _ = posix.raise(posix.SIGABRT); | 204 | _ = posix.raise(posix.SIGABRT); |
| 205 | _ = posix.raise(posix.SIGKILL); | 205 | _ = posix.raise(posix.SIGKILL); |
| 206 | while (true) {} | 206 | while (true) {} |
| ... | @@ -211,6 +211,12 @@ pub fn abort() noreturn { | ... | @@ -211,6 +211,12 @@ pub fn abort() noreturn { |
| 211 | } | 211 | } |
| 212 | windows.ExitProcess(3); | 212 | windows.ExitProcess(3); |
| 213 | }, | 213 | }, |
| | 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 | }, |
| 214 | Os.uefi => { | 220 | Os.uefi => { |
| 215 | // TODO there's gotta be a better thing to do here than loop forever | 221 | // TODO there's gotta be a better thing to do here than loop forever |
| 216 | while (true) {} | 222 | while (true) {} |
| ... | @@ -239,6 +245,9 @@ pub fn exit(status: u8) noreturn { | ... | @@ -239,6 +245,9 @@ pub fn exit(status: u8) noreturn { |
| 239 | Os.windows => { | 245 | Os.windows => { |
| 240 | windows.ExitProcess(status); | 246 | windows.ExitProcess(status); |
| 241 | }, | 247 | }, |
| | 248 | Os.wasi => { |
| | 249 | wasi.proc_exit(status); |
| | 250 | }, |
| 242 | else => @compileError("Unsupported OS"), | 251 | else => @compileError("Unsupported OS"), |
| 243 | } | 252 | } |
| 244 | } | 253 | } |