Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Declare setdomainname and getdomainname on Android. #4212

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

sunfishcode
Copy link
Member

Description

Declare setdomainname and getdomainname on Android.

Sources

Android [supports] setdomainname and getdomainname in API level 26.

[supports] https://github.com/aosp-google/bionic/blob/28f9101d76b709febe25977f98530d77580387d1/libc/include/unistd.h#L236

Checklist

  • Relevant tests in libc-test/semver have been updated
  • No placeholder or unstable values like *LAST or *MAX are
    included (see #3131)
  • Tested locally (cd libc-test && cargo test --target mytarget);
    especially relevant for platforms that may not be checked in CI

@rustbot
Copy link
Collaborator

rustbot commented Dec 18, 2024

r? @tgross35

rustbot has assigned @tgross35.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

yuki0iq added a commit to yuki0iq/rustix that referenced this pull request Dec 18, 2024
Use weak `setdomainname` only for android; remove this special case
once [libc#4212] is merged.

[libc#4212]: rust-lang/libc#4212
@tgross35
Copy link
Contributor

Changes lgtm, but could you instead add this to src/unix/linux_like/mod.rs and remove them from linux and emscripten?

@maurer could you double check this?

@maurer
Copy link

maurer commented Dec 23, 2024

LGTM, these two functions are in fact available since API level 26. Not aware of any special caveats for Android here other than that apps don't have CAP_SYS_ADMIN, so only platform code would be able to actually call the set side of this.

@tgross35 tgross35 added the stable-nominated This PR should be considered for cherry-pick to libc's stable release branch label Dec 31, 2024
@tgross35 tgross35 enabled auto-merge December 31, 2024 05:38
@tgross35 tgross35 disabled auto-merge December 31, 2024 05:39
@tgross35
Copy link
Contributor

Actually sorry, one request - since all linux_like OSs have this now, could you instead add the functions linux_like/mod.rs and remove from linux_like/linux/mod.rs and linux_like/emscripten/mod.rs? Same changes for the semver files.

@sunfishcode
Copy link
Member Author

Which semver file corresponds to "linux_like"? Is it linux.txt? I can't tell whether that's used for Android or not.

@tgross35
Copy link
Contributor

tgross35 commented Jan 3, 2025

Ah you're right, we don't have one for linux_like. Leaving the existing .txt files unchanged and adding to android.txt, like you currently have, is probably the correct thing to do for the semver tests.

(this test setup needs improvement at some point...)

Copy link
Contributor

@tgross35 tgross35 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@tgross35 tgross35 enabled auto-merge January 3, 2025 00:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-android O-linux O-linux-like O-unix S-waiting-on-review stable-nominated This PR should be considered for cherry-pick to libc's stable release branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants