From 697dbd3001596835879269d87f3847ce06b8c83b Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Fri, 28 Dec 2018 21:13:12 -0700 Subject: [PATCH] 0.1.46 - add sigprocmask --- Cargo.toml | 2 +- src/call.rs | 5 +++++ src/flag.rs | 4 ++++ src/number.rs | 1 + 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 324bdd4..695ab23 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "redox_syscall" -version = "0.1.45" +version = "0.1.46" description = "A Rust library to access raw Redox system calls" license = "MIT" authors = ["Jeremy Soller "] diff --git a/src/call.rs b/src/call.rs index 7aad04a..3b44185 100644 --- a/src/call.rs +++ b/src/call.rs @@ -322,6 +322,11 @@ pub fn sigaction(sig: usize, act: Option<&SigAction>, oldact: Option<&mut SigAct restorer as usize) } } +/// Get and/or set signal masks +pub fn sigprocmask(how: usize, set: &[u64; 2], oset: &mut [u64; 2]) -> Result { + unsafe { syscall3(SYS_SIGPROCMASK, how, set.as_ptr() as usize, oset.as_mut_ptr() as usize) } +} + // Return from signal handler pub fn sigreturn() -> Result { unsafe { syscall0(SYS_SIGRETURN) } diff --git a/src/flag.rs b/src/flag.rs index 283e8e4..f4e7a6e 100644 --- a/src/flag.rs +++ b/src/flag.rs @@ -102,6 +102,10 @@ pub const SIGSYS: usize = 31; pub const SIG_DFL: usize = 0; pub const SIG_IGN: usize = 1; +pub const SIG_BLOCK: usize = 0; +pub const SIG_UNBLOCK: usize = 1; +pub const SIG_SETMASK: usize = 2; + pub const SA_NOCLDSTOP: usize = 0x00000001; pub const SA_NOCLDWAIT: usize = 0x00000002; pub const SA_SIGINFO: usize = 0x00000004; diff --git a/src/number.rs b/src/number.rs index be2c11e..4d55d0a 100644 --- a/src/number.rs +++ b/src/number.rs @@ -68,6 +68,7 @@ pub const SYS_SETREGID: usize = 204; pub const SYS_SETRENS: usize = 952; pub const SYS_SETREUID: usize = 203; pub const SYS_SIGACTION: usize =67; +pub const SYS_SIGPROCMASK:usize=126; pub const SYS_SIGRETURN: usize =119; pub const SYS_UMASK: usize = 60; pub const SYS_WAITPID: usize = 7;