Skip to content

Commit

Permalink
Declare setdomainname and getdomainname on Android.
Browse files Browse the repository at this point in the history
Android [supports] `setdomainname` and `getdomainname` in API level 26.

[supports] https://github.com/aosp-google/bionic/blob/28f9101d76b709febe25977f98530d77580387d1/libc/include/unistd.h#L236
  • Loading branch information
sunfishcode committed Dec 18, 2024
1 parent fd5b78c commit d497e1d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions libc-test/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2102,6 +2102,9 @@ fn test_android(target: &str) {
// Added in API level 26, but some tests use level 24.
"endgrent" => true,

// Added in API level 26, but some tests use level 24.
"getdomainname" | "setdomainname" => true,

// FIXME: bad function pointers:
"isalnum" | "isalpha" | "iscntrl" | "isdigit" | "isgraph" | "islower" | "isprint"
| "ispunct" | "isspace" | "isupper" | "isxdigit" | "isblank" | "tolower"
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 @@ -3324,6 +3324,7 @@ getaddrinfo
getchar
getchar_unlocked
getcwd
getdomainname
getegid
getenv
geteuid
Expand Down Expand Up @@ -3720,6 +3721,7 @@ sendmsg
sendto
servent
setbuf
setdomainname
setegid
setenv
seteuid
Expand Down
3 changes: 3 additions & 0 deletions src/unix/linux_like/android/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4084,6 +4084,9 @@ extern "C" {
newpath: *const c_char,
flags: c_uint,
) -> c_int;

pub fn getdomainname(name: *mut c_char, len: size_t) -> c_int;
pub fn setdomainname(name: *const c_char, len: size_t) -> c_int;
}

cfg_if! {
Expand Down

0 comments on commit d497e1d

Please sign in to comment.