We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e295907 commit c2c052fCopy full SHA for c2c052f
src/sys/signal.rs
@@ -372,6 +372,7 @@ mod ffi {
372
pub fn pthread_sigmask(how: c_int, set: *const sigset_t, oldset: *mut sigset_t) -> c_int;
373
374
pub fn kill(pid: pid_t, signum: c_int) -> c_int;
375
+ pub fn raise(signum: c_int) -> c_int;
376
}
377
378
@@ -541,6 +542,16 @@ pub fn kill(pid: libc::pid_t, signum: SigNum) -> Result<()> {
541
542
Ok(())
543
544
545
+pub fn raise(signum: SigNum) -> Result<()> {
546
+ let res = unsafe { ffi::raise(signum) };
547
+
548
+ if res < 0 {
549
+ return Err(Error::Sys(Errno::last()));
550
+ }
551
552
+ Ok(())
553
+}
554
555
#[cfg(test)]
556
mod tests {
557
use super::*;
0 commit comments