From 32dd38bbb854264337a9918406dffdc84f8b3a56 Mon Sep 17 00:00:00 2001 From: Josh Megnauth Date: Thu, 25 Jun 2026 14:35:23 -0400 Subject: [PATCH] redox: Unmask most of `fs`, some of `time` Redox supports most of the *at functions as well as some of the `time` header. --- Cargo.toml | 6 ++-- src/backend/libc/conv.rs | 7 +---- src/backend/libc/fs/mod.rs | 2 +- src/backend/libc/fs/syscalls.rs | 37 ++++++---------------- src/backend/libc/fs/types.rs | 3 +- src/backend/libc/io/syscalls.rs | 2 -- src/backend/libc/thread/syscalls.rs | 4 +-- src/backend/libc/time/syscalls.rs | 17 +++------- src/fs/at.rs | 49 +++++++---------------------- src/fs/mod.rs | 4 +-- src/io/read_write.rs | 2 -- src/thread/clock.rs | 1 - src/thread/mod.rs | 2 -- src/time/clock.rs | 2 +- tests/fs/chmodat.rs | 2 +- tests/fs/fcntl.rs | 2 +- tests/fs/file.rs | 1 - tests/fs/invalid_offset.rs | 2 +- tests/fs/linkat.rs | 1 - tests/fs/mkdirat.rs | 1 - tests/fs/mknodat.rs | 2 +- tests/fs/special.rs | 2 +- tests/fs/y2038.rs | 2 -- tests/thread/clocks.rs | 3 -- 24 files changed, 42 insertions(+), 114 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 656b11cc5..36239afd2 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.189", 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.189", 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.189" 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/conv.rs b/src/backend/libc/conv.rs index c333f5cf8..60e213093 100644 --- a/src/backend/libc/conv.rs +++ b/src/backend/libc/conv.rs @@ -38,12 +38,7 @@ pub(super) fn borrowed_fd(fd: BorrowedFd<'_>) -> LibcFd { #[cfg(all( feature = "alloc", - not(any( - windows, - target_os = "espidf", - target_os = "horizon", - target_os = "redox" - )) + not(any(windows, target_os = "espidf", target_os = "horizon")) ))] #[inline] pub(super) fn owned_fd(fd: OwnedFd) -> LibcFd { diff --git a/src/backend/libc/fs/mod.rs b/src/backend/libc/fs/mod.rs index dd584c01b..392127b99 100644 --- a/src/backend/libc/fs/mod.rs +++ b/src/backend/libc/fs/mod.rs @@ -1,6 +1,6 @@ #[cfg(all( feature = "alloc", - not(any(target_os = "espidf", target_os = "horizon", target_os = "redox")) + not(any(target_os = "espidf", target_os = "horizon")) ))] pub(crate) mod dir; #[cfg(linux_kernel)] diff --git a/src/backend/libc/fs/syscalls.rs b/src/backend/libc/fs/syscalls.rs index c95eaf561..8f30349db 100644 --- a/src/backend/libc/fs/syscalls.rs +++ b/src/backend/libc/fs/syscalls.rs @@ -1,9 +1,9 @@ //! libc syscalls supporting `rustix::fs`. use crate::backend::c; -#[cfg(any(not(target_os = "redox"), feature = "alloc"))] -use crate::backend::conv::ret_usize; -use crate::backend::conv::{borrowed_fd, c_str, ret, ret_c_int, ret_off_t, ret_owned_fd}; +use crate::backend::conv::{ + borrowed_fd, c_str, ret, ret_c_int, ret_off_t, ret_owned_fd, ret_usize, +}; use crate::fd::{BorrowedFd, OwnedFd}; #[allow(unused_imports)] use crate::ffi; @@ -12,7 +12,7 @@ use crate::ffi::CStr; use crate::ffi::CString; #[cfg(not(any(target_os = "espidf", target_os = "horizon", target_os = "vita")))] use crate::fs::Access; -#[cfg(not(any(target_os = "espidf", target_os = "redox")))] +#[cfg(not(target_os = "espidf"))] use crate::fs::AtFlags; #[cfg(not(any( netbsdlike, @@ -55,7 +55,6 @@ use crate::fs::Timestamps; apple, target_os = "espidf", target_os = "horizon", - target_os = "redox", target_os = "vita", target_os = "wasi" )))] @@ -206,7 +205,6 @@ fn openat_via_syscall( } } -#[cfg(not(target_os = "redox"))] pub(crate) fn openat( dirfd: BorrowedFd<'_>, path: &CStr, @@ -288,7 +286,6 @@ pub(crate) fn readlink(path: &CStr, buf: &mut [u8]) -> io::Result { unsafe { ret_usize(c::readlink(c_str(path), buf.as_mut_ptr().cast(), buf.len()) as isize) } } -#[cfg(not(target_os = "redox"))] #[inline] pub(crate) unsafe fn readlinkat( dirfd: BorrowedFd<'_>, @@ -302,7 +299,6 @@ pub(crate) fn mkdir(path: &CStr, mode: Mode) -> io::Result<()> { unsafe { ret(c::mkdir(c_str(path), mode.bits() as c::mode_t)) } } -#[cfg(not(target_os = "redox"))] pub(crate) fn mkdirat(dirfd: BorrowedFd<'_>, path: &CStr, mode: Mode) -> io::Result<()> { unsafe { ret(c::mkdirat( @@ -338,7 +334,7 @@ pub(crate) fn link(old_path: &CStr, new_path: &CStr) -> io::Result<()> { unsafe { ret(c::link(c_str(old_path), c_str(new_path))) } } -#[cfg(not(any(target_os = "espidf", target_os = "redox")))] +#[cfg(not(target_os = "espidf"))] pub(crate) fn linkat( old_dirfd: BorrowedFd<'_>, old_path: &CStr, @@ -401,7 +397,7 @@ pub(crate) fn unlink(path: &CStr) -> io::Result<()> { unsafe { ret(c::unlink(c_str(path))) } } -#[cfg(not(any(target_os = "espidf", target_os = "redox")))] +#[cfg(not(target_os = "espidf"))] pub(crate) fn unlinkat(dirfd: BorrowedFd<'_>, path: &CStr, flags: AtFlags) -> io::Result<()> { // macOS ≤ 10.9 lacks `unlinkat`. #[cfg(target_os = "macos")] @@ -628,7 +624,6 @@ pub(crate) fn symlink(old_path: &CStr, new_path: &CStr) -> io::Result<()> { unsafe { ret(c::symlink(c_str(old_path), c_str(new_path))) } } -#[cfg(not(target_os = "redox"))] pub(crate) fn symlinkat( old_path: &CStr, new_dirfd: BorrowedFd<'_>, @@ -730,7 +725,7 @@ pub(crate) fn lstat(path: &CStr) -> io::Result { } } -#[cfg(not(any(target_os = "espidf", target_os = "redox")))] +#[cfg(not(target_os = "espidf"))] pub(crate) fn statat(dirfd: BorrowedFd<'_>, path: &CStr, flags: AtFlags) -> io::Result { // See the comments in `fstat` about using `crate::fs::statx` here. #[cfg(all( @@ -812,7 +807,6 @@ pub(crate) fn access(path: &CStr, access: Access) -> io::Result<()> { target_os = "emscripten", target_os = "espidf", target_os = "horizon", - target_os = "redox", target_os = "vita" )))] pub(crate) fn accessat( @@ -880,12 +874,7 @@ pub(crate) fn accessat( Ok(()) } -#[cfg(not(any( - target_os = "espidf", - target_os = "horizon", - target_os = "redox", - target_os = "vita" -)))] +#[cfg(not(any(target_os = "espidf", target_os = "horizon", target_os = "vita")))] pub(crate) fn utimensat( dirfd: BorrowedFd<'_>, path: &CStr, @@ -1102,12 +1091,7 @@ pub(crate) fn chmod(path: &CStr, mode: Mode) -> io::Result<()> { unsafe { ret(c::chmod(c_str(path), mode.bits() as c::mode_t)) } } -#[cfg(not(any( - linux_kernel, - target_os = "espidf", - target_os = "redox", - target_os = "wasi" -)))] +#[cfg(not(any(linux_kernel, target_os = "espidf", target_os = "wasi")))] pub(crate) fn chmodat( dirfd: BorrowedFd<'_>, path: &CStr, @@ -1185,7 +1169,7 @@ pub(crate) fn fclonefileat( } } -#[cfg(not(any(target_os = "espidf", target_os = "redox", target_os = "wasi")))] +#[cfg(not(any(target_os = "espidf", target_os = "wasi")))] pub(crate) fn chownat( dirfd: BorrowedFd<'_>, path: &CStr, @@ -1209,7 +1193,6 @@ pub(crate) fn chownat( apple, target_os = "espidf", target_os = "horizon", - target_os = "redox", target_os = "vita", target_os = "wasi" )))] diff --git a/src/backend/libc/fs/types.rs b/src/backend/libc/fs/types.rs index 6a4ed6d7e..85444fb3b 100644 --- a/src/backend/libc/fs/types.rs +++ b/src/backend/libc/fs/types.rs @@ -28,7 +28,7 @@ bitflags! { } } -#[cfg(not(any(target_os = "espidf", target_os = "horizon", target_os = "redox")))] +#[cfg(not(any(target_os = "espidf", target_os = "horizon")))] bitflags! { /// `AT_*` constants for use with [`openat`], [`statat`], and other `*at` /// functions. @@ -630,7 +630,6 @@ impl FileType { target_os = "haiku", target_os = "horizon", target_os = "nto", - target_os = "redox", target_os = "vita" )))] #[inline] diff --git a/src/backend/libc/io/syscalls.rs b/src/backend/libc/io/syscalls.rs index 46f7c5859..4b44b1b5d 100644 --- a/src/backend/libc/io/syscalls.rs +++ b/src/backend/libc/io/syscalls.rs @@ -99,7 +99,6 @@ pub(crate) fn writev(fd: BorrowedFd<'_>, bufs: &[IoSlice<'_>]) -> io::Result c::c_int); target_os = "espidf", target_os = "freebsd", // FreeBSD 12 has clock_nanosleep, but libc targets FreeBSD 11. target_os = "haiku", + target_os = "redox", target_os = "horizon", target_os = "openbsd", - target_os = "redox", target_os = "vita", target_os = "wasi", )))] @@ -244,7 +243,6 @@ fn clock_nanosleep_absolute_old(id: crate::clockid::ClockId, request: &Timespec) } } -#[cfg(not(target_os = "redox"))] #[inline] pub(crate) fn nanosleep(request: &Timespec) -> NanosleepRelativeResult { // Old 32-bit version: libc has `nanosleep` but it is not y2038 safe by diff --git a/src/backend/libc/time/syscalls.rs b/src/backend/libc/time/syscalls.rs index 8c730cef0..5ace363ac 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 { @@ -292,11 +288,7 @@ pub(crate) fn clock_settime(id: ClockId, timespec: Timespec) -> 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")))))] #[cfg(fix_y2038)] fn clock_settime_old(id: ClockId, timespec: Timespec) -> io::Result<()> { let old_timespec = c::timespec { @@ -484,7 +476,8 @@ pub(crate) fn timerfd_gettime(fd: BorrowedFd<'_>) -> io::Result { target_os = "freebsd", target_os = "fuchsia", target_os = "illumos", - target_os = "netbsd" + target_os = "netbsd", + target_os = "redox" ))] #[cfg(fix_y2038)] fn timerfd_gettime_old(fd: BorrowedFd<'_>) -> io::Result { diff --git a/src/fs/at.rs b/src/fs/at.rs index f74bd4351..9f404e79f 100644 --- a/src/fs/at.rs +++ b/src/fs/at.rs @@ -12,7 +12,7 @@ use crate::buffer::Buffer; use crate::fd::OwnedFd; #[cfg(not(any(target_os = "espidf", target_os = "horizon", target_os = "vita")))] use crate::fs::Access; -#[cfg(not(any(target_os = "espidf", target_os = "redox")))] +#[cfg(not(target_os = "espidf"))] use crate::fs::AtFlags; #[cfg(apple)] use crate::fs::CloneFlags; @@ -46,23 +46,13 @@ use {crate::fs::Timestamps, crate::timespec::Nsecs}; /// `UTIME_NOW` for use with [`utimensat`]. /// /// [`utimensat`]: crate::fs::utimensat -#[cfg(not(any( - target_os = "espidf", - target_os = "horizon", - target_os = "redox", - target_os = "vita" -)))] +#[cfg(not(any(target_os = "espidf", target_os = "horizon", target_os = "vita")))] pub const UTIME_NOW: Nsecs = backend::c::UTIME_NOW as Nsecs; /// `UTIME_OMIT` for use with [`utimensat`]. /// /// [`utimensat`]: crate::fs::utimensat -#[cfg(not(any( - target_os = "espidf", - target_os = "horizon", - target_os = "redox", - target_os = "vita" -)))] +#[cfg(not(any(target_os = "espidf", target_os = "horizon", target_os = "vita")))] pub const UTIME_OMIT: Nsecs = backend::c::UTIME_OMIT as Nsecs; /// `openat(dirfd, path, oflags, mode)`—Opens a file. @@ -79,7 +69,6 @@ pub const UTIME_OMIT: Nsecs = backend::c::UTIME_OMIT as Nsecs; /// /// [POSIX]: https://pubs.opengroup.org/onlinepubs/9799919799/functions/openat.html /// [Linux]: https://man7.org/linux/man-pages/man2/openat.2.html -#[cfg(not(target_os = "redox"))] #[inline] pub fn openat( dirfd: Fd, @@ -102,7 +91,7 @@ pub fn openat( /// /// [POSIX]: https://pubs.opengroup.org/onlinepubs/9799919799/functions/readlinkat.html /// [Linux]: https://man7.org/linux/man-pages/man2/readlinkat.2.html -#[cfg(all(feature = "alloc", not(target_os = "redox")))] +#[cfg(feature = "alloc")] #[cfg_attr(docsrs, doc(cfg(feature = "alloc")))] #[inline] pub fn readlinkat>>( @@ -113,7 +102,7 @@ pub fn readlinkat>>( path.into_with_c_str(|path| _readlinkat(dirfd.as_fd(), path, reuse.into())) } -#[cfg(all(feature = "alloc", not(target_os = "redox")))] +#[cfg(feature = "alloc")] #[allow(unsafe_code)] fn _readlinkat(dirfd: BorrowedFd<'_>, path: &CStr, mut buffer: Vec) -> io::Result { buffer.clear(); @@ -177,7 +166,6 @@ fn _readlinkat(dirfd: BorrowedFd<'_>, path: &CStr, mut buffer: Vec) -> io::R /// /// [POSIX]: https://pubs.opengroup.org/onlinepubs/9799919799/functions/readlinkat.html /// [Linux]: https://man7.org/linux/man-pages/man2/readlinkat.2.html -#[cfg(not(target_os = "redox"))] #[inline] pub fn readlinkat_raw>( dirfd: Fd, @@ -200,7 +188,6 @@ pub fn readlinkat_raw>( /// /// [POSIX]: https://pubs.opengroup.org/onlinepubs/9799919799/functions/mkdirat.html /// [Linux]: https://man7.org/linux/man-pages/man2/mkdirat.2.html -#[cfg(not(target_os = "redox"))] #[inline] pub fn mkdirat(dirfd: Fd, path: P, mode: Mode) -> io::Result<()> { path.into_with_c_str(|path| backend::fs::syscalls::mkdirat(dirfd.as_fd(), path, mode)) @@ -215,7 +202,7 @@ pub fn mkdirat(dirfd: Fd, path: P, mode: Mode) -> io::Re /// /// [POSIX]: https://pubs.opengroup.org/onlinepubs/9799919799/functions/linkat.html /// [Linux]: https://man7.org/linux/man-pages/man2/linkat.2.html -#[cfg(not(any(target_os = "espidf", target_os = "redox")))] +#[cfg(not(target_os = "espidf"))] #[inline] pub fn linkat( old_dirfd: PFd, @@ -249,7 +236,7 @@ pub fn linkat( /// [`REMOVEDIR`]: AtFlags::REMOVEDIR /// [POSIX]: https://pubs.opengroup.org/onlinepubs/9799919799/functions/unlinkat.html /// [Linux]: https://man7.org/linux/man-pages/man2/unlinkat.2.html -#[cfg(not(any(target_os = "espidf", target_os = "redox")))] +#[cfg(not(target_os = "espidf"))] #[inline] pub fn unlinkat(dirfd: Fd, path: P, flags: AtFlags) -> io::Result<()> { path.into_with_c_str(|path| backend::fs::syscalls::unlinkat(dirfd.as_fd(), path, flags)) @@ -327,7 +314,6 @@ pub fn renameat_with( /// /// [POSIX]: https://pubs.opengroup.org/onlinepubs/9799919799/functions/symlinkat.html /// [Linux]: https://man7.org/linux/man-pages/man2/symlinkat.2.html -#[cfg(not(target_os = "redox"))] #[inline] pub fn symlinkat( old_path: P, @@ -354,7 +340,7 @@ pub fn symlinkat( /// [Linux]: https://man7.org/linux/man-pages/man2/fstatat.2.html /// [`Mode::from_raw_mode`]: crate::fs::Mode::from_raw_mode /// [`FileType::from_raw_mode`]: crate::fs::FileType::from_raw_mode -#[cfg(not(any(target_os = "espidf", target_os = "redox")))] +#[cfg(not(target_os = "espidf"))] #[inline] #[doc(alias = "fstatat")] pub fn statat(dirfd: Fd, path: P, flags: AtFlags) -> io::Result { @@ -377,12 +363,7 @@ pub fn statat(dirfd: Fd, path: P, flags: AtFlags) -> io: /// /// [POSIX]: https://pubs.opengroup.org/onlinepubs/9799919799/functions/faccessat.html /// [Linux]: https://man7.org/linux/man-pages/man2/faccessat.2.html -#[cfg(not(any( - target_os = "espidf", - target_os = "horizon", - target_os = "vita", - target_os = "redox" -)))] +#[cfg(not(any(target_os = "espidf", target_os = "horizon", target_os = "vita",)))] #[inline] #[doc(alias = "faccessat")] pub fn accessat( @@ -402,12 +383,7 @@ pub fn accessat( /// /// [POSIX]: https://pubs.opengroup.org/onlinepubs/9799919799/functions/utimensat.html /// [Linux]: https://man7.org/linux/man-pages/man2/utimensat.2.html -#[cfg(not(any( - target_os = "espidf", - target_os = "horizon", - target_os = "vita", - target_os = "redox" -)))] +#[cfg(not(any(target_os = "espidf", target_os = "horizon", target_os = "vita",)))] #[inline] pub fn utimensat( dirfd: Fd, @@ -430,7 +406,7 @@ pub fn utimensat( /// /// [POSIX]: https://pubs.opengroup.org/onlinepubs/9799919799/functions/fchmodat.html /// [Linux]: https://man7.org/linux/man-pages/man2/fchmodat.2.html -#[cfg(not(any(target_os = "espidf", target_os = "wasi", target_os = "redox")))] +#[cfg(not(any(target_os = "espidf", target_os = "wasi")))] #[inline] #[doc(alias = "fchmodat")] pub fn chmodat( @@ -475,7 +451,6 @@ pub fn fclonefileat( target_os = "horizon", target_os = "vita", target_os = "wasi", - target_os = "redox", )))] #[inline] pub fn mknodat( @@ -518,7 +493,7 @@ pub fn mkfifoat(dirfd: Fd, path: P, mode: Mode) -> io::R /// /// [POSIX]: https://pubs.opengroup.org/onlinepubs/9799919799/functions/fchownat.html /// [Linux]: https://man7.org/linux/man-pages/man2/fchownat.2.html -#[cfg(not(any(target_os = "espidf", target_os = "wasi", target_os = "redox")))] +#[cfg(not(any(target_os = "espidf", target_os = "wasi")))] #[inline] #[doc(alias = "fchownat")] pub fn chownat( diff --git a/src/fs/mod.rs b/src/fs/mod.rs index dfeed87ad..8af33a05d 100644 --- a/src/fs/mod.rs +++ b/src/fs/mod.rs @@ -7,7 +7,7 @@ mod constants; mod copy_file_range; #[cfg(all( feature = "alloc", - not(any(target_os = "espidf", target_os = "horizon", target_os = "redox")) + not(any(target_os = "espidf", target_os = "horizon")) ))] mod dir; #[cfg(not(any( @@ -75,7 +75,7 @@ pub use constants::*; pub use copy_file_range::copy_file_range; #[cfg(all( feature = "alloc", - not(any(target_os = "espidf", target_os = "horizon", target_os = "redox")) + not(any(target_os = "espidf", target_os = "horizon")) ))] pub use dir::{Dir, DirEntry}; #[cfg(not(any( diff --git a/src/io/read_write.rs b/src/io/read_write.rs index 0e0969103..a2c13a9ac 100644 --- a/src/io/read_write.rs +++ b/src/io/read_write.rs @@ -219,7 +219,6 @@ pub fn writev(fd: Fd, bufs: &[IoSlice<'_>]) -> io::Result { target_os = "haiku", target_os = "horizon", target_os = "nto", - target_os = "redox", target_os = "solaris", target_os = "vita", )))] @@ -258,7 +257,6 @@ pub fn preadv(fd: Fd, bufs: &mut [IoSliceMut<'_>], offset: u64) -> io: target_os = "haiku", target_os = "horizon", target_os = "nto", - target_os = "redox", target_os = "solaris", target_os = "vita", )))] diff --git a/src/thread/clock.rs b/src/thread/clock.rs index d6be40e87..d31af9a39 100644 --- a/src/thread/clock.rs +++ b/src/thread/clock.rs @@ -9,7 +9,6 @@ pub use crate::timespec::{Nsecs, Secs, Timespec}; target_os = "espidf", target_os = "freebsd", // FreeBSD 12 has clock_nanosleep, but libc targets FreeBSD 11. target_os = "openbsd", - target_os = "redox", target_os = "vita", target_os = "wasi", )))] diff --git a/src/thread/mod.rs b/src/thread/mod.rs index 26d1de427..0b34b0e59 100644 --- a/src/thread/mod.rs +++ b/src/thread/mod.rs @@ -1,6 +1,5 @@ //! Thread-associated operations. -#[cfg(not(target_os = "redox"))] mod clock; #[cfg(linux_kernel)] pub mod futex; @@ -18,7 +17,6 @@ mod sched_yield; #[cfg(linux_kernel)] mod setns; -#[cfg(not(target_os = "redox"))] pub use clock::*; #[cfg(linux_kernel)] pub use id::*; diff --git a/src/time/clock.rs b/src/time/clock.rs index bdc2b11c8..95368ed28 100644 --- a/src/time/clock.rs +++ b/src/time/clock.rs @@ -24,7 +24,7 @@ pub use crate::clockid::{ClockId, DynamicClockId}; /// [OpenBSD]: https://man.openbsd.org/clock_getres.2 /// [DragonFly BSD]: https://man.dragonflybsd.org/?command=clock_getres§ion=2 /// [illumos]: https://illumos.org/man/3C/clock_getres -#[cfg(not(any(target_os = "redox", target_os = "wasi")))] +#[cfg(not(target_os = "wasi"))] #[inline] #[must_use] pub fn clock_getres(id: ClockId) -> Timespec { diff --git a/tests/fs/chmodat.rs b/tests/fs/chmodat.rs index 7567ed7fd..0a8c75873 100644 --- a/tests/fs/chmodat.rs +++ b/tests/fs/chmodat.rs @@ -27,7 +27,7 @@ fn test_chmod() { assert_ne!(reverted.st_mode as u64 & libc::S_IRWXU as u64, 0); } -#[cfg(not(any(target_os = "redox", target_os = "wasi")))] +#[cfg(not(target_os = "wasi"))] #[test] fn test_chmodat() { use rustix::fs::{chmodat, openat, statat, symlinkat, AtFlags, Mode, OFlags, CWD}; diff --git a/tests/fs/fcntl.rs b/tests/fs/fcntl.rs index e2c4414b7..738406acd 100644 --- a/tests/fs/fcntl.rs +++ b/tests/fs/fcntl.rs @@ -1,4 +1,4 @@ -#[cfg(not(any(target_os = "redox", target_os = "wasi")))] +#[cfg(not(target_os = "wasi"))] #[test] fn test_fcntl_dupfd_cloexec() { use rustix::fd::AsFd as _; diff --git a/tests/fs/file.rs b/tests/fs/file.rs index cb7e0c7fe..a4bdba7e3 100644 --- a/tests/fs/file.rs +++ b/tests/fs/file.rs @@ -9,7 +9,6 @@ )))] use core::num::NonZeroU64; -#[cfg(not(target_os = "redox"))] #[test] fn test_file() { rustix::fs::accessat( diff --git a/tests/fs/invalid_offset.rs b/tests/fs/invalid_offset.rs index cf84c9912..8e16ba623 100644 --- a/tests/fs/invalid_offset.rs +++ b/tests/fs/invalid_offset.rs @@ -7,7 +7,7 @@ //! These tests are disabled on iOS/macOS since those platforms kill the //! process with `Signal::XFSZ` instead of returning an error. -#![cfg(not(any(target_os = "redox", target_os = "wasi")))] +#![cfg(not(target_os = "wasi"))] use rustix::fs::SeekFrom; diff --git a/tests/fs/linkat.rs b/tests/fs/linkat.rs index 42ad21177..ad161cc81 100644 --- a/tests/fs/linkat.rs +++ b/tests/fs/linkat.rs @@ -29,7 +29,6 @@ fn test_link() { ); } -#[cfg(not(target_os = "redox"))] #[test] fn test_linkat() { use rustix::fs::{linkat, openat, readlinkat, statat, AtFlags, Mode, OFlags, CWD}; diff --git a/tests/fs/mkdirat.rs b/tests/fs/mkdirat.rs index f405490b5..fbd6351e0 100644 --- a/tests/fs/mkdirat.rs +++ b/tests/fs/mkdirat.rs @@ -15,7 +15,6 @@ fn test_mkdir() { rmdir(tmp.path().join("file")).unwrap(); } -#[cfg(not(target_os = "redox"))] #[test] fn test_mkdirat() { use rustix::fs::{ diff --git a/tests/fs/mknodat.rs b/tests/fs/mknodat.rs index cf35b95ea..8ba53cee0 100644 --- a/tests/fs/mknodat.rs +++ b/tests/fs/mknodat.rs @@ -1,4 +1,4 @@ -#[cfg(not(any(apple, target_os = "redox", target_os = "wasi")))] +#[cfg(not(any(apple, target_os = "wasi")))] #[test] fn test_mknodat() { use rustix::fs::{ diff --git a/tests/fs/special.rs b/tests/fs/special.rs index de72b027e..58bb0e36f 100644 --- a/tests/fs/special.rs +++ b/tests/fs/special.rs @@ -1,5 +1,5 @@ #[cfg(feature = "process")] -#[cfg(not(any(target_os = "redox", target_os = "wasi")))] +#[cfg(not(target_os = "wasi"))] #[test] fn test_special_fds() { use rustix::fs::{fstat, open, openat, Mode, OFlags, Stat, ABS, CWD}; diff --git a/tests/fs/y2038.rs b/tests/fs/y2038.rs index 749dd043f..31164a397 100644 --- a/tests/fs/y2038.rs +++ b/tests/fs/y2038.rs @@ -5,7 +5,6 @@ #[cfg(not(all(target_env = "musl", target_pointer_width = "32")))] #[cfg(not(all(target_os = "android", target_pointer_width = "32")))] #[cfg(not(all(target_os = "emscripten", target_pointer_width = "32")))] -#[cfg(not(target_os = "redox"))] #[cfg(not(target_os = "cygwin"))] #[test] fn test_y2038_with_utimensat() { @@ -81,7 +80,6 @@ fn test_y2038_with_utimensat() { #[cfg(not(all(target_env = "musl", target_pointer_width = "32")))] #[cfg(not(all(target_os = "android", target_pointer_width = "32")))] #[cfg(not(all(target_os = "emscripten", target_pointer_width = "32")))] -#[cfg(not(target_os = "redox"))] #[cfg(not(target_os = "cygwin"))] #[test] fn test_y2038_with_futimens() { diff --git a/tests/thread/clocks.rs b/tests/thread/clocks.rs index 915f3e35e..9ebe7dd0a 100644 --- a/tests/thread/clocks.rs +++ b/tests/thread/clocks.rs @@ -8,13 +8,11 @@ target_os = "wasi", )))] use rustix::thread::{clock_nanosleep_absolute, clock_nanosleep_relative, ClockId}; -#[cfg(not(target_os = "redox"))] use { rustix::io, rustix::thread::{nanosleep, NanosleepRelativeResult, Timespec}, }; -#[cfg(not(target_os = "redox"))] #[test] fn test_invalid_nanosleep() { match nanosleep(&Timespec { @@ -154,7 +152,6 @@ fn test_invalid_nanosleep_relative() { } } -#[cfg(not(target_os = "redox"))] #[test] fn test_zero_nanosleep() { match nanosleep(&Timespec {