Fix sigsuspend and add it to the sigqueue test.

This commit is contained in:
4lDO2
2024-08-04 23:02:04 +02:00
parent 9701e9c544
commit 2b7a1ea94b
6 changed files with 69 additions and 24 deletions
+9 -2
View File
@@ -380,13 +380,20 @@ pub unsafe extern "C" fn sigwait(set: *const sigset_t, sig: *mut c_int) -> c_int
#[no_mangle]
pub unsafe extern "C" fn sigtimedwait(
set: *const sigset_t,
sig: *mut siginfo, // https://github.com/mozilla/cbindgen/issues/621
// s/siginfo_t/siginfo due to https://github.com/mozilla/cbindgen/issues/621
sig: *mut siginfo,
// POSIX leaves behavior unspecified if this is NULL, but on both Linux and Redox, NULL is used
// to differentiate between sigtimedwait and sigwaitinfo internally
tp: *const timespec,
) -> c_int {
Sys::sigtimedwait(&*set, sig.as_mut(), &*tp)
Sys::sigtimedwait(&*set, sig.as_mut(), tp.as_ref())
.map(|()| 0)
.or_minus_one_errno()
}
#[no_mangle]
pub unsafe extern "C" fn sigwaitinfo(set: *const sigset_t, sig: *mut siginfo_t) -> c_int {
sigtimedwait(set, sig, core::ptr::null())
}
pub const _signal_strings: [&str; 32] = [
"Unknown signal\0",