Skip to content

Commit 83407c5

Browse files
bors[bot]posborne
andcommitted
Merge #1077
1077: ifaddrs: add ifaddrs support for android r=asomers a=posborne Support under bionic/android is the same as under Linux for what is exposed by this code. Co-authored-by: Paul Osborne <[email protected]>
2 parents 5a2586b + 80b85fb commit 83407c5

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ This project adheres to [Semantic Versioning](http://semver.org/).
99
([#1079](https://github.com/nix-rust/nix/pull/1079))
1010

1111
### Changed
12+
- Support for `ifaddrs` now present when building for Android.
13+
([#1077](https://github.com/nix-rust/nix/pull/1077))
14+
1215
### Fixed
1316
### Removed
1417

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)