From fa72a8905d70eb7d83ac477d41a0a51b712aa41b Mon Sep 17 00:00:00 2001 From: Josh Megnauth Date: Wed, 16 Sep 2026 21:29:12 -0400 Subject: [PATCH] redox: pause and clock_settime --- Cargo.toml | 6 +++--- src/backend/libc/event/syscalls.rs | 2 +- src/backend/libc/time/syscalls.rs | 14 +++----------- src/event/mod.rs | 4 ++-- 4 files changed, 9 insertions(+), 17 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 656b11cc5..d15164e24 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -35,7 +35,7 @@ rustc-std-workspace-alloc = { version = "1.0.0", optional = true } # not aliased [target.'cfg(all(not(rustix_use_libc), not(miri), target_os = "linux", any(target_endian = "little", any(target_arch = "s390x", target_arch = "powerpc")), any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc"), all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "s390x"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))'.dependencies] linux-raw-sys = { version = "0.12", default-features = false, features = ["auxvec", "general", "errno", "ioctl", "no_std", "elf"] } libc_errno = { package = "errno", version = "0.3.10", default-features = false, optional = true } -libc = { version = "0.2.182", default-features = false, optional = true } +libc = { version = "0.2.190", default-features = false, optional = true } # Dependencies for platforms where only libc is supported: # @@ -43,7 +43,7 @@ libc = { version = "0.2.182", default-features = false, optional = true } # backend, so enable its dependencies unconditionally. [target.'cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", any(target_endian = "little", any(target_arch = "s390x", target_arch = "powerpc")), any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc"), all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "s390x"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64")))))))'.dependencies] libc_errno = { package = "errno", version = "0.3.10", default-features = false } -libc = { version = "0.2.182", default-features = false } +libc = { version = "0.2.190", default-features = false } # Additional dependencies for Linux and Android with the libc backend: # @@ -69,7 +69,7 @@ default-features = false [dev-dependencies] tempfile = "3.5.0" -libc = "0.2.171" +libc = "0.2.190" libc_errno = { package = "errno", version = "0.3.10", default-features = false } serial_test = "2.0.0" memoffset = "0.9.0" diff --git a/src/backend/libc/event/syscalls.rs b/src/backend/libc/event/syscalls.rs index 268638287..c9373180d 100644 --- a/src/backend/libc/event/syscalls.rs +++ b/src/backend/libc/event/syscalls.rs @@ -477,7 +477,7 @@ pub(crate) fn port_send( unsafe { ret(c::port_send(borrowed_fd(port), events, userdata)) } } -#[cfg(not(any(target_os = "redox", target_os = "wasi")))] +#[cfg(not(target_os = "wasi"))] pub(crate) fn pause() { let r = unsafe { c::pause() }; let errno = libc_errno::errno().0; diff --git a/src/backend/libc/time/syscalls.rs b/src/backend/libc/time/syscalls.rs index 8c730cef0..6ba469ec2 100644 --- a/src/backend/libc/time/syscalls.rs +++ b/src/backend/libc/time/syscalls.rs @@ -17,11 +17,7 @@ use crate::io; #[cfg(not(fix_y2038))] use crate::timespec::as_libc_timespec_mut_ptr; #[cfg(not(fix_y2038))] -#[cfg(not(any( - target_os = "redox", - target_os = "wasi", - all(apple, not(target_os = "macos")) -)))] +#[cfg(not(any(target_os = "wasi", all(apple, not(target_os = "macos")))))] use crate::timespec::as_libc_timespec_ptr; #[cfg(all(target_env = "gnu", fix_y2038))] use crate::timespec::LibcTimespec; @@ -53,7 +49,7 @@ weak!(fn __timerfd_gettime64(c::c_int, *mut LibcItimerspec) -> c::c_int); #[cfg(all(target_env = "gnu", fix_y2038))] weak!(fn __timerfd_settime64(c::c_int, c::c_int, *const LibcItimerspec, *mut LibcItimerspec) -> c::c_int); -#[cfg(not(any(target_os = "redox", target_os = "wasi")))] +#[cfg(not(target_os = "wasi"))] #[inline] #[must_use] pub(crate) fn clock_getres(id: ClockId) -> Timespec { @@ -258,11 +254,7 @@ fn clock_gettime_dynamic_old(id: c::clockid_t) -> io::Result { }) } -#[cfg(not(any( - target_os = "redox", - target_os = "wasi", - all(apple, not(target_os = "macos")) -)))] +#[cfg(not(any(target_os = "wasi", all(apple, not(target_os = "macos")))))] #[inline] pub(crate) fn clock_settime(id: ClockId, timespec: Timespec) -> io::Result<()> { // Old 32-bit version: libc has `clock_gettime` but it is not y2038 safe by diff --git a/src/event/mod.rs b/src/event/mod.rs index 29dfc2272..e925379cb 100644 --- a/src/event/mod.rs +++ b/src/event/mod.rs @@ -11,7 +11,7 @@ pub mod epoll; mod eventfd; #[cfg(bsd)] pub mod kqueue; -#[cfg(not(any(windows, target_os = "redox", target_os = "wasi")))] +#[cfg(not(any(windows, target_os = "wasi")))] mod pause; mod poll; #[cfg(solarish)] @@ -27,7 +27,7 @@ pub use crate::timespec::{Nsecs, Secs, Timespec}; target_os = "espidf" ))] pub use eventfd::{eventfd, EventfdFlags}; -#[cfg(not(any(windows, target_os = "redox", target_os = "wasi")))] +#[cfg(not(any(windows, target_os = "wasi")))] pub use pause::*; pub use poll::{poll, PollFd, PollFlags}; #[cfg(any(bsd, linux_kernel, windows, target_os = "wasi"))]