summaryrefslogtreecommitdiff
path: root/src/host/script.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/host/script.zig')
-rw-r--r--src/host/script.zig5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/host/script.zig b/src/host/script.zig
index 7818c6b..12774b6 100644
--- a/src/host/script.zig
+++ b/src/host/script.zig
@@ -34,6 +34,7 @@
//! load LIBRARY swap in another build of the sketch
//! reload load the watched library again
//! await-reload SECONDS run frames until a build replaces the library
+//! kill die by SIGKILL, as a crash would
//!
//! `{name}` is replaced by `--define name=value` from the command line.
//!
@@ -226,6 +227,10 @@ fn step(host: *Host, arena: std.mem.Allocator, command: []const u8, rest: []cons
try std.Io.sleep(host.io, .fromMilliseconds(10), .awake);
}
return;
+ } else if (eq(u8, command, "kill")) {
+ // A crash, for tests of what survives one: SIGKILL, no cleanup.
+ _ = std.os.linux.kill(std.os.linux.getpid(), .KILL);
+ return;
} else if (eq(u8, command, "quit")) {
host.quit = true;
return;