fix(ext/node): Add SIGPOLL and SIGUNUSED signals (#24259)

This commit is contained in:
Divy Srivastava 2024-06-19 13:41:09 +05:30 committed by GitHub
parent 209b286813
commit 8dd7beb7c6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 16 additions and 2 deletions

View File

@ -4416,6 +4416,8 @@ declare namespace Deno {
| "SIGINFO"
| "SIGINT"
| "SIGIO"
| "SIGPOLL"
| "SIGUNUSED"
| "SIGKILL"
| "SIGPIPE"
| "SIGPROF"

View File

@ -339,9 +339,9 @@ pub fn signal_str_to_int(s: &str) -> Result<libc::c_int, AnyError> {
"SIGVTALRM" => Ok(26),
"SIGPROF" => Ok(27),
"SIGWINCH" => Ok(28),
"SIGIO" => Ok(29),
"SIGIO" | "SIGPOLL" => Ok(29),
"SIGPWR" => Ok(30),
"SIGSYS" => Ok(31),
"SIGSYS" | "SIGUNUSED" => Ok(31),
_ => Err(type_error(format!("Invalid signal : {s}"))),
}
}

View File

@ -304,3 +304,15 @@ Deno.test(
);
},
);
Deno.test(
{ ignore: Deno.build.os !== "linux" },
function signalAliasLinux() {
const i = () => {};
Deno.addSignalListener("SIGUNUSED", i);
Deno.addSignalListener("SIGPOLL", i);
Deno.removeSignalListener("SIGUNUSED", i);
Deno.removeSignalListener("SIGPOLL", i);
},
);