Implement sigaltstack.

This commit is contained in:
4lDO2
2024-07-01 19:52:48 +02:00
parent 6d5d0eb61e
commit c639fd37ba
9 changed files with 130 additions and 24 deletions
+7 -2
View File
@@ -65,8 +65,13 @@ impl PalSignal for Sys {
.map(|_| ())
}
unsafe fn sigaltstack(ss: *const stack_t, old_ss: *mut stack_t) -> c_int {
e(syscall!(SIGALTSTACK, ss, old_ss)) as c_int
unsafe fn sigaltstack(ss: Option<&stack_t>, old_ss: Option<&mut stack_t>) -> Result<(), Errno> {
e_raw(syscall!(
SIGALTSTACK,
ss.map_or_else(core::ptr::null, |x| x as *const _),
old_ss.map_or_else(core::ptr::null_mut, |x| x as *mut _)
))
.map(|_| ())
}
unsafe fn sigpending(set: *mut sigset_t) -> c_int {