Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eventfd module sys::eventfd should be exposed for target_os = android #1480

Closed
flxo opened this issue Jul 26, 2021 · 0 comments · Fixed by #1481
Closed

Eventfd module sys::eventfd should be exposed for target_os = android #1480

flxo opened this issue Jul 26, 2021 · 0 comments · Fixed by #1481

Comments

@flxo
Copy link
Contributor

flxo commented Jul 26, 2021

Androids bionic supports eventfd. The libc crate also exposes eventfd for target android.

nix currently includes eventfd only for target_os = "linux".

Any objections agains a small PR that add android to the targets where the eventfd module shall be declared:

diff --git a/src/sys/mod.rs b/src/sys/mod.rs
index 43877a1..b43587b 100644
--- a/src/sys/mod.rs
+++ b/src/sys/mod.rs
@@ -17,7 +17,7 @@ pub mod epoll;
           target_os = "openbsd"))]
 pub mod event;
 
-#[cfg(target_os = "linux")]
+#[cfg(any(target_os = "android", target_os = "linux"))]
 pub mod eventfd;
 
 #[cfg(any(target_os = "android",
bors bot added a commit that referenced this issue Jul 29, 2021
1481: Include `sys::eventfd` for target_os = "android" r=asomers a=flxo

Androids bionic [supports](https://android.googlesource.com/platform/bionic/+/d1ad4f6/libc/include/sys/eventfd.h) `eventfd`. The `libc` crate also exposes [`eventfd`](https://github.com/rust-lang/libc/blob/36a6a8e254db89cd31d178b4ba102055ceabf9a8/src/unix/linux_like/android/mod.rs#L2648) for target `android`. 

Extend the conditional compilation check to include the target_os "android".

Fixes #1480

Co-authored-by: Felix Obenhuber <[email protected]>
@bors bors bot closed this as completed in 8ed34b7 Jul 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant