diff --git a/src/header/time/mod.rs b/src/header/time/mod.rs index c84bb9a943..04d6b60e89 100644 --- a/src/header/time/mod.rs +++ b/src/header/time/mod.rs @@ -64,6 +64,7 @@ pub(crate) struct timer_internal_t { pub process_pid: platform::types::pid_t, } +#[cfg(target_os = "redox")] impl timer_internal_t { pub unsafe fn from_raw(timerid: timer_t) -> &'static Mutex { unsafe { &*(timerid as *const Mutex) } diff --git a/src/platform/redox/mod.rs b/src/platform/redox/mod.rs index 45d6020693..fe4979a38f 100644 --- a/src/platform/redox/mod.rs +++ b/src/platform/redox/mod.rs @@ -1392,6 +1392,11 @@ impl Pal for Sys { Self::timer_gettime(timerid, ovalue)?; } + if value.it_value.is_zero() { + timer_st.next_wake_version += 1; + return Ok(()); + } + timer_st.next_wake_time = { let mut val = value.clone(); if flags & TIMER_ABSTIME == 0 {