Skip to content

Commit

Permalink
add eventfd feature
Browse files Browse the repository at this point in the history
this disables eventfd on linux

Signed-off-by: Harald Hoyer <harald@hoyer.xyz>
  • Loading branch information
haraldh committed Jun 22, 2023
1 parent c2f79f6 commit 5852388
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ include = [
# By default Mio only provides a shell implementation.
default = ["log"]

eventfd = []

# Enables the `Poll` and `Registry` types.
os-poll = []
# Enables additional OS specific extensions, e.g. Unix `pipe(2)`.
Expand Down
6 changes: 4 additions & 2 deletions src/sys/unix/waker.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#[cfg(any(target_os = "linux", target_os = "android"))]
#[cfg(all(feature = "eventfd", any(target_os = "linux", target_os = "android")))]
mod eventfd {
use crate::sys::Selector;
use crate::{Interest, Token};
Expand Down Expand Up @@ -55,7 +55,7 @@ mod eventfd {
}
}

#[cfg(any(target_os = "linux", target_os = "android"))]
#[cfg(all(feature = "eventfd", any(target_os = "linux", target_os = "android")))]
pub use self::eventfd::Waker;

#[cfg(any(
Expand Down Expand Up @@ -106,6 +106,7 @@ mod kqueue {
pub use self::kqueue::Waker;

#[cfg(any(
not(feature = "eventfd"),
target_os = "dragonfly",
target_os = "illumos",
target_os = "netbsd",
Expand Down Expand Up @@ -176,6 +177,7 @@ mod pipe {
}

#[cfg(any(
not(feature = "eventfd"),
target_os = "dragonfly",
target_os = "illumos",
target_os = "netbsd",
Expand Down

0 comments on commit 5852388

Please sign in to comment.