nix
nix copied to clipboard
Add SIGRTMIN and SIGRTMAX constants
Or at least remove Error on Signal::from_c_int, if signal is not between 0 and NSIG, so I can pass custom signals. Option here is also excess.
I use transmute for my purpose now and it works fine, but I wish getting rid of unsafe block.
let signal: Signal = unsafe { std::mem::transmute(signal::SIGRTMIN() + 1) };
match kill(pid, signal) {
...
}
I think this would be a reasonable change. However, you'll have to add support to libc first. And you'll need to deal with the fact that SIGRTMIN is a constant on some platforms and a function on others.
FYI, SIGRTMIN and SIGRTMAX have been added to libc in https://github.com/rust-lang/libc/pull/2304.
This is related to https://github.com/nix-rust/nix/issues/495.