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:
parent
e3904a784e
commit
5c5b4d7355
3 changed files with 16 additions and 2 deletions
2
cli/tsc/dts/lib.deno.ns.d.ts
vendored
2
cli/tsc/dts/lib.deno.ns.d.ts
vendored
|
@ -4416,6 +4416,8 @@ declare namespace Deno {
|
|||
| "SIGINFO"
|
||||
| "SIGINT"
|
||||
| "SIGIO"
|
||||
| "SIGPOLL"
|
||||
| "SIGUNUSED"
|
||||
| "SIGKILL"
|
||||
| "SIGPIPE"
|
||||
| "SIGPROF"
|
||||
|
|
|
@ -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}"))),
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
},
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue