diff --git a/changelog/2259.added.md b/changelog/2259.added.md new file mode 100644 index 0000000000..244d9adb23 --- /dev/null +++ b/changelog/2259.added.md @@ -0,0 +1 @@ +Added `sys::eventfd` support on FreeBSD diff --git a/src/sys/eventfd.rs b/src/sys/eventfd.rs index 704a3e6873..50a4f091bd 100644 --- a/src/sys/eventfd.rs +++ b/src/sys/eventfd.rs @@ -4,9 +4,9 @@ use std::os::unix::io::{FromRawFd, OwnedFd, AsRawFd, AsFd, RawFd, BorrowedFd}; libc_bitflags! { pub struct EfdFlags: libc::c_int { - EFD_CLOEXEC; // Since Linux 2.6.27 - EFD_NONBLOCK; // Since Linux 2.6.27 - EFD_SEMAPHORE; // Since Linux 2.6.30 + EFD_CLOEXEC; // Since Linux 2.6.27/FreeBSD 13.0 + EFD_NONBLOCK; // Since Linux 2.6.27/FreeBSD 13.0 + EFD_SEMAPHORE; // Since Linux 2.6.30/FreeBSD 13.0 } } @@ -81,4 +81,4 @@ impl From for OwnedFd { fn from(x: EventFd) -> OwnedFd { x.0 } -} \ No newline at end of file +} diff --git a/src/sys/mod.rs b/src/sys/mod.rs index 1d875ccd51..93339d1935 100644 --- a/src/sys/mod.rs +++ b/src/sys/mod.rs @@ -20,7 +20,7 @@ feature! { #[cfg(bsd)] pub mod event; - #[cfg(linux_android)] + #[cfg(any(linux_android, target_os = "freebsd"))] #[allow(missing_docs)] pub mod eventfd; }