authorgravatar for swoogan@gmail.comColin Svingen <swoogan@gmail.com> 2020-01-05 20:30:28-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-01-06 14:04:55-05:00
log4e6ad8efd9fcefb820acf4a03fc4ab9157f85c1b
tree802e47271075ab07cb0d5bc138c8d257bb4d3a63
parentc30106c90665079f525129e344cc1c13e4db162b

Removes proc_raise from WASI implementation


3 files changed, 2 insertions(+), 11 deletions(-)

lib/std/builtin.zig+2-3
...@@ -416,7 +416,7 @@ pub const CallOptions = struct {...@@ -416,7 +416,7 @@ pub const CallOptions = struct {
416/// therefore must be kept in sync with the compiler implementation.416/// therefore must be kept in sync with the compiler implementation.
417pub const TestFn = struct {417pub const TestFn = struct {
418 name: []const u8,418 name: []const u8,
419 func: fn()anyerror!void,419 func: fn () anyerror!void,
420};420};
421421
422/// This function type is used by the Zig language code generation and422/// This function type is used by the Zig language code generation and
...@@ -443,8 +443,7 @@ pub fn default_panic(msg: []const u8, error_return_trace: ?*StackTrace) noreturn...@@ -443,8 +443,7 @@ pub fn default_panic(msg: []const u8, error_return_trace: ?*StackTrace) noreturn
443 },443 },
444 .wasi => {444 .wasi => {
445 std.debug.warn("{}", .{msg});445 std.debug.warn("{}", .{msg});
446 _ = std.os.wasi.proc_raise(std.os.wasi.SIGABRT);446 std.os.abort();
447 unreachable;
448 },447 },
449 .uefi => {448 .uefi => {
450 // TODO look into using the debug info and logging helpful messages449 // TODO look into using the debug info and logging helpful messages
lib/std/os.zig-7
...@@ -216,13 +216,6 @@ pub fn raise(sig: u8) RaiseError!void {...@@ -216,13 +216,6 @@ pub fn raise(sig: u8) RaiseError!void {
216 }216 }
217 }217 }
218218
219 if (builtin.os == .wasi) {
220 switch (wasi.proc_raise(SIGABRT)) {
221 0 => return,
222 else => |err| return unexpectedErrno(err),
223 }
224 }
225
226 if (builtin.os == .linux) {219 if (builtin.os == .linux) {
227 var set: linux.sigset_t = undefined;220 var set: linux.sigset_t = undefined;
228 // block application signals221 // block application signals
lib/std/os/wasi.zig-1
...@@ -67,7 +67,6 @@ pub extern "wasi_unstable" fn path_unlink_file(fd: fd_t, path: [*]const u8, path...@@ -67,7 +67,6 @@ pub extern "wasi_unstable" fn path_unlink_file(fd: fd_t, path: [*]const u8, path
67pub extern "wasi_unstable" fn poll_oneoff(in: *const subscription_t, out: *event_t, nsubscriptions: usize, nevents: *usize) errno_t;67pub extern "wasi_unstable" fn poll_oneoff(in: *const subscription_t, out: *event_t, nsubscriptions: usize, nevents: *usize) errno_t;
6868
69pub extern "wasi_unstable" fn proc_exit(rval: exitcode_t) noreturn;69pub extern "wasi_unstable" fn proc_exit(rval: exitcode_t) noreturn;
70pub extern "wasi_unstable" fn proc_raise(sig: signal_t) errno_t;
7170
72pub extern "wasi_unstable" fn random_get(buf: [*]u8, buf_len: usize) errno_t;71pub extern "wasi_unstable" fn random_get(buf: [*]u8, buf_len: usize) errno_t;
7372