Add sigismember

This commit is contained in:
Jeremy Soller
2019-01-05 09:40:08 -07:00
parent bd956e5fe4
commit 961d1304ab
+14 -2
View File
@@ -131,9 +131,21 @@ pub extern "C" fn siginterrupt(sig: c_int, flag: c_int) -> c_int {
unimplemented!();
}
// #[no_mangle]
#[no_mangle]
pub extern "C" fn sigismember(set: *const sigset_t, signo: c_int) -> c_int {
unimplemented!();
if signo <= 0 || signo as usize > NSIG {
unsafe {
platform::errno = errno::EINVAL;
}
return -1;
}
if let Some(set) = unsafe { (set as *mut SigSet).as_mut() } {
if set.contains(signo as usize - 1) {
return 1;
}
}
0
}
extern "C" {