Uh oh!
There was an error while loading. Please reload this page.
Implement accept4 on Android as raw syscall. - #1968
Conversation
rust-highfive
commented
Oct 31, 2020
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @JohnTitor (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
3c8fd95 to
5bcac36CompareJohnTitor
commented
Nov 2, 2020
@bors r+ |
bors
commented
Nov 2, 2020
📌 Commit 5bcac36 has been approved by |
bors
commented
Nov 2, 2020
Implement accept4 on Android as raw syscall. This PR implements `accept4()` on Android using `syscall()` instead of the `accept4()` wrapper. This is done because the `accept4()` wrapper wasn't added to Androids `libc` until version 5.0 (API level 21). By using `syscall` directly, `accept4` will also work on older Android versions. The kernel itself has supported it since Linux 2.6.28, which was shipped with stock Android since version 1.6 already: https://en.wikipedia.org/wiki/Android_version_history#Android_1.6_Donut_(API_4) At the moment, the CI for the rust repo still uses API level 14. Although I also opened a PR to bump that too: rust-lang/rust#78601. However, it might make sense to keep the old API level in CI if this is merged.
bors
commented
Nov 2, 2020
💔 Test failed - checks-actions |
Uh oh!
There was an error while loading. Please reload this page.
Applied the suggestion :) Also had to remove the trailing comma from the argument list. Should I squash the commits? |
JohnTitor
commented
Nov 3, 2020
Yeah, r=me once it's done. |
This avoids relying on Android 5.0 / API level 21. The Linux kernel used by Android supports the syscall (except in truly ancient Android versions), but the Android libc did not expose a wrapper.
9c8b7c8 to
36affa2Comparede-vri-es
commented
Nov 3, 2020
Squashed :) @bors r=JohnTitor |
bors
commented
Nov 3, 2020
@de-vri-es: 🔑 Insufficient privileges: Not in reviewers |
de-vri-es
commented
Nov 3, 2020
Awh, bors didn't like that :( |
JohnTitor
commented
Nov 3, 2020
Thanks! |
bors
commented
Nov 3, 2020
📌 Commit 36affa2 has been approved by |
bors
commented
Nov 3, 2020
bors
commented
Nov 3, 2020
☀️ Test successful - checks-actions, checks-cirrus-freebsd-11, checks-cirrus-freebsd-12, checks-cirrus-freebsd-13 |
This PR implements
accept4()on Android usingsyscall()instead of theaccept4()wrapper.This is done because the
accept4()wrapper wasn't added to Androidslibcuntil version 5.0 (API level 21). By usingsyscalldirectly,accept4will also work on older Android versions.The kernel itself has supported it since Linux 2.6.28, which was shipped with stock Android since version 1.6 already: https://en.wikipedia.org/wiki/Android_version_history#Android_1.6_Donut_(API_4)
At the moment, the CI for the rust repo still uses API level 14. Although I also opened a PR to bump that too: rust-lang/rust#78601. However, it might make sense to keep the old API level in CI if this is merged.