From ef3dbfde165d2af4a382e9fb2388eda7a2333fff Mon Sep 17 00:00:00 2001 From: Josh Megnauth Date: Sun, 17 Aug 2025 00:28:40 -0400 Subject: [PATCH] redox: Resource, syslog, and some fcntl consts --- src/fcntl.rs | 3 +-- src/sys/mod.rs | 7 +------ src/sys/resource.rs | 6 ++++-- src/syslog.rs | 4 ++-- 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/src/fcntl.rs b/src/fcntl.rs index 6504c1dcf2..cd351255ae 100644 --- a/src/fcntl.rs +++ b/src/fcntl.rs @@ -171,10 +171,9 @@ libc_bitflags!( #[cfg(linux_android)] O_NOATIME; /// Don't attach the device as the process' controlling terminal. - #[cfg(not(target_os = "redox"))] O_NOCTTY; /// Same as `O_NONBLOCK`. - #[cfg(not(any(target_os = "redox", target_os = "haiku", target_os = "cygwin")))] + #[cfg(not(any(target_os = "haiku", target_os = "cygwin")))] O_NDELAY; /// `open()` will fail if the given path is a symbolic link. O_NOFOLLOW; diff --git a/src/sys/mod.rs b/src/sys/mod.rs index c17c7be39e..b79b014c29 100644 --- a/src/sys/mod.rs +++ b/src/sys/mod.rs @@ -93,12 +93,7 @@ feature! { pub mod reboot; } -#[cfg(not(any( - target_os = "redox", - target_os = "fuchsia", - solarish, - target_os = "haiku" -)))] +#[cfg(not(any(target_os = "fuchsia", solarish, target_os = "haiku")))] feature! { #![feature = "resource"] pub mod resource; diff --git a/src/sys/resource.rs b/src/sys/resource.rs index 449698dbe2..ef6b6ddf55 100644 --- a/src/sys/resource.rs +++ b/src/sys/resource.rs @@ -20,7 +20,8 @@ cfg_if! { target_os = "android", target_os = "aix", all(target_os = "linux", not(target_env = "gnu")), - target_os = "cygwin" + target_os = "cygwin", + target_os = "redox", ))]{ use libc::rlimit; } @@ -51,7 +52,8 @@ libc_enum! { target_os = "android", target_os = "aix", all(target_os = "linux", not(any(target_env = "gnu", target_env = "uclibc"))), - target_os = "cygwin" + target_os = "cygwin", + target_os = "redox", ), repr(i32))] #[non_exhaustive] pub enum Resource { diff --git a/src/syslog.rs b/src/syslog.rs index 7894978029..e6394128d9 100644 --- a/src/syslog.rs +++ b/src/syslog.rs @@ -17,7 +17,7 @@ use std::ptr; // if the string it points to is changed, syslog() may start prepending the changed // string, and if the string it points to ceases to exist, the results are // undefined. Most portable is to use a string constant. -#[cfg(target_os = "linux")] +#[cfg(any(target_os = "linux", target_os = "redox"))] pub fn openlog( ident: Option<&'static std::ffi::CStr>, logopt: LogFlags, @@ -215,7 +215,7 @@ libc_bitflags! { /// which file descriptors are allocated. LOG_NDELAY; /// Write the message to standard error output as well to the system log. - #[cfg(not(any(solarish, target_os = "redox", target_os = "cygwin")))] + #[cfg(not(any(solarish, target_os = "cygwin")))] LOG_PERROR; } }