Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions libc-test/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1847,6 +1847,8 @@ fn test_android(target: &str) {

// FIXME(android): "'__uint128' undeclared" in C
"__uint128" => true,
// Added in API level 24
"if_nameindex" => true,

_ => false,
}
Expand Down Expand Up @@ -2093,6 +2095,9 @@ fn test_android(target: &str) {
| "ispunct" | "isspace" | "isupper" | "isxdigit" | "isblank" | "tolower"
| "toupper" => true,

// Added in API level 24
"if_nameindex" | "if_freenameindex" => true,

_ => false,
}
});
Expand Down
2 changes: 2 additions & 0 deletions libc-test/semver/android.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3382,7 +3382,9 @@ group
hostent
id_t
idtype_t
if_freenameindex
if_indextoname
if_nameindex
if_nametoindex
ifaddrs
ifconf
Expand Down
8 changes: 8 additions & 0 deletions src/unix/linux_like/android/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,11 @@ s! {
pub ifr6_prefixlen: u32,
pub ifr6_ifindex: c_int,
}

pub struct if_nameindex {
pub if_index: c_uint,
pub if_name: *mut c_char,
}
}

s_no_extra_traits! {
Expand Down Expand Up @@ -4094,6 +4099,9 @@ extern "C" {
newpath: *const c_char,
flags: c_uint,
) -> c_int;

pub fn if_nameindex() -> *mut if_nameindex;
pub fn if_freenameindex(ptr: *mut if_nameindex);
}

cfg_if! {
Expand Down
Loading