aboutsummaryrefslogtreecommitdiff
path: root/lib/std/os.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2019-12-12 18:56:39 -0500
committerAndrew Kelley <andrew@ziglang.org>2019-12-12 18:56:39 -0500
commit7699b5b997c7a024a6d9558df0ec72d71ef402fe (patch)
treeea996d6252efe24158a802fb50c1a28c3b3d6717 /lib/std/os.zig
parent81f1f72197113a45e827d5c984e219a28aa28083 (diff)
parentfff3c1fff4c3ebfcb2bd4f08a43ae7815b5c446b (diff)
downloadzig-7699b5b997c7a024a6d9558df0ec72d71ef402fe.tar.gz
zig-7699b5b997c7a024a6d9558df0ec72d71ef402fe.zip
Merge branch 'Xe-expose-callMain'
closes #3891
Diffstat (limited to 'lib/std/os.zig')
-rw-r--r--lib/std/os.zig20
1 files changed, 12 insertions, 8 deletions
diff --git a/lib/std/os.zig b/lib/std/os.zig
index 04de59d6e1..6d49bcd38e 100644
--- a/lib/std/os.zig
+++ b/lib/std/os.zig
@@ -187,19 +187,23 @@ pub fn abort() noreturn {
}
windows.kernel32.ExitProcess(3);
}
- if (builtin.link_libc) {
- system.abort();
+ if (!builtin.link_libc and builtin.os == .linux) {
+ raise(SIGABRT) catch {};
+
+ // TODO the rest of the implementation of abort() from musl libc here
+
+ raise(SIGKILL) catch {};
+ exit(127);
}
if (builtin.os == .uefi) {
exit(0); // TODO choose appropriate exit code
}
+ if (builtin.os == .wasi) {
+ @breakpoint();
+ exit(1);
+ }
- raise(SIGABRT) catch {};
-
- // TODO the rest of the implementation of abort() from musl libc here
-
- raise(SIGKILL) catch {};
- exit(127);
+ system.abort();
}
pub const RaiseError = UnexpectedError;