From a4f80c9e57501405a49cf5c7b84a5156ba756092 Mon Sep 17 00:00:00 2001 From: Thomas de Zeeuw Date: Sat, 25 May 2024 15:08:00 +0200 Subject: [PATCH] Support Hermit without cfg flags --- src/poll.rs | 23 +++++++++++++++++++---- src/sys/unix/waker.rs | 4 +--- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/src/poll.rs b/src/poll.rs index 7c943f141..6ba9a9131 100644 --- a/src/poll.rs +++ b/src/poll.rs @@ -1,7 +1,12 @@ #[cfg(all( unix, not(mio_unsupported_force_poll_poll), - not(any(target_os = "espidf", target_os = "solaris", target_os = "vita")), + not(any( + target_os = "espidf", + target_os = "hermit", + target_os = "solaris", + target_os = "vita" + )), ))] use std::os::unix::io::{AsRawFd, RawFd}; #[cfg(all(debug_assertions, not(target_os = "wasi")))] @@ -430,7 +435,12 @@ impl Poll { #[cfg(all( unix, not(mio_unsupported_force_poll_poll), - not(any(target_os = "espidf", target_os = "solaris", target_os = "vita")), + not(any( + target_os = "espidf", + target_os = "hermit", + target_os = "solaris", + target_os = "vita" + )), ))] impl AsRawFd for Poll { fn as_raw_fd(&self) -> RawFd { @@ -721,7 +731,12 @@ impl fmt::Debug for Registry { #[cfg(all( unix, not(mio_unsupported_force_poll_poll), - not(any(target_os = "espidf", target_os = "solaris", target_os = "vita")), + not(any( + target_os = "espidf", + target_os = "hermit", + target_os = "solaris", + target_os = "vita" + )), ))] impl AsRawFd for Registry { fn as_raw_fd(&self) -> RawFd { @@ -733,7 +748,7 @@ cfg_os_poll! { #[cfg(all( unix, not(mio_unsupported_force_poll_poll), - not(any(target_os = "espidf", target_os = "solaris", target_os = "vita")), + not(any(target_os = "espidf", target_os = "hermit", target_os = "solaris", target_os = "vita")), ))] #[test] pub fn as_raw_fd() { diff --git a/src/sys/unix/waker.rs b/src/sys/unix/waker.rs index a5ecf34d0..d99c02fee 100644 --- a/src/sys/unix/waker.rs +++ b/src/sys/unix/waker.rs @@ -168,14 +168,12 @@ mod eventfd { any( target_os = "android", target_os = "espidf", + target_os = "hermit", target_os = "linux", ) ))] pub(crate) use self::eventfd::WakerInternal; -#[cfg(target_os = "hermit")] -pub(crate) use self::eventfd::WakerInternal; - #[cfg(all( not(mio_unsupported_force_waker_pipe), any(