Skip to content

Commit

Permalink
sys::eventfd enabled for FreeBSD. (nix-rust#2259)
Browse files Browse the repository at this point in the history
* sys::eventfd enabled for FreeBSD.

* CHANGELOG entry
  • Loading branch information
devnexen authored Dec 10, 2023
1 parent 9113d60 commit 43505e0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions changelog/2259.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added `sys::eventfd` support on FreeBSD
8 changes: 4 additions & 4 deletions src/sys/eventfd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down Expand Up @@ -81,4 +81,4 @@ impl From<EventFd> for OwnedFd {
fn from(x: EventFd) -> OwnedFd {
x.0
}
}
}
2 changes: 1 addition & 1 deletion src/sys/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 43505e0

Please sign in to comment.