diff --git a/cli/tests/unit_node/child_process_test.ts b/cli/tests/unit_node/child_process_test.ts index e89fd7d792..d4a2a4cc68 100644 --- a/cli/tests/unit_node/child_process_test.ts +++ b/cli/tests/unit_node/child_process_test.ts @@ -599,3 +599,22 @@ Deno.test( assertStringIncludes(output, "close"); }, ); + +Deno.test({ + name: "[node/child_process spawn] supports SIGIOT signal", + ignore: Deno.build.os === "windows", + async fn() { + const script = path.join( + path.dirname(path.fromFileUrl(import.meta.url)), + "testdata", + "child_process_stdin.js", + ); + const cp = spawn(Deno.execPath(), ["run", "-A", script]); + const p = withTimeout(); + cp.on("exit", () => p.resolve()); + cp.kill("SIGIOT"); + await p; + assert(cp.killed); + assertEquals(cp.signalCode, "SIGIOT"); + }, +}); diff --git a/runtime/ops/signal.rs b/runtime/ops/signal.rs index 93e1cfef28..ba9a2a1785 100644 --- a/runtime/ops/signal.rs +++ b/runtime/ops/signal.rs @@ -113,6 +113,7 @@ pub fn signal_str_to_int(s: &str) -> Result { "SIGQUIT" => Ok(3), "SIGILL" => Ok(4), "SIGTRAP" => Ok(5), + "SIGIOT" => Ok(6), "SIGABRT" => Ok(6), "SIGEMT" => Ok(7), "SIGFPE" => Ok(8), @@ -193,6 +194,7 @@ pub fn signal_str_to_int(s: &str) -> Result { "SIGQUIT" => Ok(3), "SIGILL" => Ok(4), "SIGTRAP" => Ok(5), + "SIGIOT" => Ok(6), "SIGABRT" => Ok(6), "SIGBUS" => Ok(7), "SIGFPE" => Ok(8), @@ -269,6 +271,7 @@ pub fn signal_str_to_int(s: &str) -> Result { "SIGQUIT" => Ok(3), "SIGILL" => Ok(4), "SIGTRAP" => Ok(5), + "SIGIOT" => Ok(6), "SIGABRT" => Ok(6), "SIGEMT" => Ok(7), "SIGFPE" => Ok(8),