diff --git a/redox-rt/src/signal.rs b/redox-rt/src/signal.rs index 14a39c316f..779c70a9f1 100644 --- a/redox-rt/src/signal.rs +++ b/redox-rt/src/signal.rs @@ -6,10 +6,17 @@ use syscall::{ }; use crate::{ - arch::*, current_proc_fd, proc::FdGuard, protocol::{ + arch::*, + current_proc_fd, + proc::FdGuard, + protocol::{ ProcCall, RtSigInfo, ThreadCall, SIGCHLD, SIGKILL, SIGSTOP, SIGTSTP, SIGTTIN, SIGTTOU, SIGURG, SIGWINCH, - }, static_proc_info, sync::Mutex, sys::{proc_call, this_thread_call}, RtTcb, Tcb + }, + static_proc_info, + sync::Mutex, + sys::{proc_call, this_thread_call}, + RtTcb, Tcb, }; #[cfg(target_arch = "x86_64")] @@ -158,10 +165,12 @@ unsafe fn inner(stack: &mut SigStack) { SigactionKind::Default => { let sig = (stack.sig_num & 0x3f) as u8; - let _ = proc_call(**current_proc_fd(), &mut [], CallFlags::empty(), &[ - ProcCall::Exit as u64, - u64::from(sig) << 8, - ]); + let _ = proc_call( + **current_proc_fd(), + &mut [], + CallFlags::empty(), + &[ProcCall::Exit as u64, u64::from(sig) << 8], + ); core::intrinsics::abort() } SigactionKind::Handled { handler } => handler, diff --git a/redox-rt/src/sys.rs b/redox-rt/src/sys.rs index 9ae42a51f2..d0a69da489 100644 --- a/redox-rt/src/sys.rs +++ b/redox-rt/src/sys.rs @@ -340,3 +340,7 @@ pub fn posix_setsid() -> Result<()> { this_proc_call(&mut [], CallFlags::empty(), &[ProcCall::Setsid as u64])?; Ok(()) } +pub fn posix_nanosleep(rqtp: &TimeSpec, rmtp: &mut TimeSpec) -> Result<()> { + wrapper(false, false, || syscall::nanosleep(rqtp, rmtp))?; + Ok(()) +} diff --git a/src/platform/redox/mod.rs b/src/platform/redox/mod.rs index 3dec9da52d..3c9b273b97 100644 --- a/src/platform/redox/mod.rs +++ b/src/platform/redox/mod.rs @@ -742,7 +742,7 @@ impl Pal for Sys { } else { redox_rmtp = unsafe { redox_timespec::from(&*rmtp) }; } - match syscall::nanosleep(&redox_rqtp, &mut redox_rmtp) { + match redox_rt::sys::posix_nanosleep(&redox_rqtp, &mut redox_rmtp) { Ok(_) => Ok(()), Err(Error { errno: EINTR }) => { unsafe {