1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-24 15:19:26 -05:00

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 Bartek Iwańczuk
parent e3904a784e
commit 5c5b4d7355
No known key found for this signature in database
GPG key ID: 0C6BCDDC3B3AD750
3 changed files with 16 additions and 2 deletions

View file

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

View file

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