nix icon indicating copy to clipboard operation
nix copied to clipboard

Add SIGRTMIN and SIGRTMAX constants

Open kacejot opened this issue 6 years ago • 4 comments
trafficstars

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.

kacejot avatar Oct 24 '19 17:10 kacejot

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) {
    ...
}

kacejot avatar Oct 24 '19 18:10 kacejot

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.

asomers avatar Dec 01 '19 02:12 asomers

FYI, SIGRTMIN and SIGRTMAX have been added to libc in https://github.com/rust-lang/libc/pull/2304.

mkroening avatar Aug 21 '21 18:08 mkroening

This is related to https://github.com/nix-rust/nix/issues/495.

mkroening avatar Aug 26 '21 09:08 mkroening