Make redox itimer relibc stub rather than kernel stub.

This commit is contained in:
4lDO2
2025-04-13 18:18:05 +02:00
parent a0a5b5b7fd
commit d68f5d8d3d
4 changed files with 41 additions and 27 deletions
+13 -4
View File
@@ -15,8 +15,10 @@ use crate::{
};
impl PalSignal for Sys {
unsafe fn getitimer(which: c_int, out: *mut itimerval) -> Result<()> {
e_raw(syscall!(GETITIMER, which, out))?;
fn getitimer(which: c_int, out: &mut itimerval) -> Result<()> {
unsafe {
e_raw(syscall!(GETITIMER, which, out as *mut _))?;
}
Ok(())
}
@@ -49,8 +51,15 @@ impl PalSignal for Sys {
Ok(())
}
unsafe fn setitimer(which: c_int, new: *const itimerval, old: *mut itimerval) -> Result<()> {
e_raw(unsafe { syscall!(SETITIMER, which, new, old) })?;
fn setitimer(which: c_int, new: &itimerval, old: Option<&mut itimerval>) -> Result<()> {
e_raw(unsafe {
syscall!(
SETITIMER,
which,
new as *const _,
old.map_or_else(core::ptr::null_mut, |r| r as *mut _)
)
})?;
Ok(())
}