Skip to content

Commit 43505e0

Browse files
authored
sys::eventfd enabled for FreeBSD. (#2259)
* sys::eventfd enabled for FreeBSD. * CHANGELOG entry
1 parent 9113d60 commit 43505e0

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

changelog/2259.added.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Added `sys::eventfd` support on FreeBSD

src/sys/eventfd.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ use std::os::unix::io::{FromRawFd, OwnedFd, AsRawFd, AsFd, RawFd, BorrowedFd};
44

55
libc_bitflags! {
66
pub struct EfdFlags: libc::c_int {
7-
EFD_CLOEXEC; // Since Linux 2.6.27
8-
EFD_NONBLOCK; // Since Linux 2.6.27
9-
EFD_SEMAPHORE; // Since Linux 2.6.30
7+
EFD_CLOEXEC; // Since Linux 2.6.27/FreeBSD 13.0
8+
EFD_NONBLOCK; // Since Linux 2.6.27/FreeBSD 13.0
9+
EFD_SEMAPHORE; // Since Linux 2.6.30/FreeBSD 13.0
1010
}
1111
}
1212

@@ -81,4 +81,4 @@ impl From<EventFd> for OwnedFd {
8181
fn from(x: EventFd) -> OwnedFd {
8282
x.0
8383
}
84-
}
84+
}

src/sys/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ feature! {
2020
#[cfg(bsd)]
2121
pub mod event;
2222

23-
#[cfg(linux_android)]
23+
#[cfg(any(linux_android, target_os = "freebsd"))]
2424
#[allow(missing_docs)]
2525
pub mod eventfd;
2626
}

0 commit comments

Comments
 (0)