Skip to content

Commit 01b8832

Browse files
committed
ifaddrs: add ifaddrs support for android
Support under bionic/android is the same as under Linux for what is exposed by this code.
1 parent bf5970e commit 01b8832

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
2020

2121
### Changed
2222
### Fixed
23+
- Support for `ifaddrs` now present when building for Android.
24+
([#1077](https://github.com/nix-rust/nix/pull/1077))
2325
### Removed
2426

2527
## [0.14.0] - 2019-05-21

src/ifaddrs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ pub struct InterfaceAddress {
3232
}
3333

3434
cfg_if! {
35-
if #[cfg(any(target_os = "emscripten", target_os = "fuchsia", target_os = "linux"))] {
35+
if #[cfg(any(target_os = "android", target_os = "emscripten", target_os = "fuchsia", target_os = "linux"))] {
3636
fn get_ifu_from_sockaddr(info: &libc::ifaddrs) -> *const libc::sockaddr {
3737
info.ifa_ifu
3838
}

src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ pub mod errno;
3535
pub mod features;
3636
pub mod fcntl;
3737
#[deny(missing_docs)]
38-
#[cfg(any(target_os = "dragonfly",
38+
#[cfg(any(target_os = "android",
39+
target_os = "dragonfly",
3940
target_os = "freebsd",
4041
target_os = "ios",
4142
target_os = "linux",

0 commit comments

Comments
 (0)