Skip to content

Commit 5f313db

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 5f313db

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

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)