-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Implement accept4 on x86 android with socketcall
syscall.
#2079
Conversation
r? @JohnTitor (rust-highfive has picked a reviewer for you, use r? to override) |
Looks good to me. @bors r+ |
@bors r+ |
📌 Commit 64614cf has been approved by |
Implement accept4 on x86 android with `socketcall` syscall. Linux x86 kernels before 4.3 only support the `socketcall` syscall rather than individual syscalls for socket operations. Since `libc` does a raw syscall for `accept4` on Android, it doesn't work on x86 systems. This PR instead implements `accept4` for x86 android using `socketcall`. The value for `SYS_ACCEPT4` (in contrast to `SYS_accept4` 👀) is taken from the `linux/net.h` header. Also note that the `socketcall` syscall takes all arguments as array of long ints. I've double checked with `glibc` to check how they pass arguments, since the Linux man page only says this: "args points to a block containing the actual arguments" and "only standard library implementors and kernel hackers need to know about socketcall()". This should fix rust-lang/rust#82400
💔 Test failed - checks-actions |
Pushed a fix, passes a local build for i686-linux-android (can't run the tests though). |
@bors r=joshtriplett |
📌 Commit df5f0de has been approved by |
Implement accept4 on x86 android with `socketcall` syscall. Linux x86 kernels before 4.3 only support the `socketcall` syscall rather than individual syscalls for socket operations. Since `libc` does a raw syscall for `accept4` on Android, it doesn't work on x86 systems. This PR instead implements `accept4` for x86 android using `socketcall`. The value for `SYS_ACCEPT4` (in contrast to `SYS_accept4` 👀) is taken from the `linux/net.h` header. Also note that the `socketcall` syscall takes all arguments as array of long ints. I've double checked with `glibc` to check how they pass arguments, since the Linux man page only says this: "args points to a block containing the actual arguments" and "only standard library implementors and kernel hackers need to know about socketcall()". This should fix rust-lang/rust#82400
💔 Test failed - checks-actions |
Failure:
We should tweak the test. |
e3ccd75
to
446f7a7
Compare
Thanks, let's try again :) @bors r=joshtriplett,JohnTitor |
📌 Commit 446f7a7 has been approved by |
…ohnTitor Implement accept4 on x86 android with `socketcall` syscall. Linux x86 kernels before 4.3 only support the `socketcall` syscall rather than individual syscalls for socket operations. Since `libc` does a raw syscall for `accept4` on Android, it doesn't work on x86 systems. This PR instead implements `accept4` for x86 android using `socketcall`. The value for `SYS_ACCEPT4` (in contrast to `SYS_accept4` 👀) is taken from the `linux/net.h` header. Also note that the `socketcall` syscall takes all arguments as array of long ints. I've double checked with `glibc` to check how they pass arguments, since the Linux man page only says this: "args points to a block containing the actual arguments" and "only standard library implementors and kernel hackers need to know about socketcall()". This should fix rust-lang/rust#82400
💔 Test failed - checks-actions |
Co-authored-by: Yuki Okushi <huyuumi.dev@gmail.com>
@bors r=joshtriplett,JohnTitor |
📌 Commit 629b518 has been approved by |
…ohnTitor Implement accept4 on x86 android with `socketcall` syscall. Linux x86 kernels before 4.3 only support the `socketcall` syscall rather than individual syscalls for socket operations. Since `libc` does a raw syscall for `accept4` on Android, it doesn't work on x86 systems. This PR instead implements `accept4` for x86 android using `socketcall`. The value for `SYS_ACCEPT4` (in contrast to `SYS_accept4` 👀) is taken from the `linux/net.h` header. Also note that the `socketcall` syscall takes all arguments as array of long ints. I've double checked with `glibc` to check how they pass arguments, since the Linux man page only says this: "args points to a block containing the actual arguments" and "only standard library implementors and kernel hackers need to know about socketcall()". This should fix rust-lang/rust#82400
☀️ Test successful - checks-actions, checks-cirrus-freebsd-11, checks-cirrus-freebsd-12, checks-cirrus-freebsd-13 |
This is merged on master now but bors doesn't close it, manually closing. |
Awesome, thanks for the reviews! ❤️ |
libc removed it in version 0.2.87. rust-lang/libc#2079
Re-add accept4 for Android on 32 bit ARM. `accept4` was accidentally removed from 32 bit Android targets except for x86 in #2079. This PR adds it back using the same definition as other non-x86 platforms.
Linux x86 kernels before 4.3 only support the
socketcall
syscall rather than individual syscalls for socket operations. Sincelibc
does a raw syscall foraccept4
on Android, it doesn't work on x86 systems.This PR instead implements
accept4
for x86 android usingsocketcall
. The value forSYS_ACCEPT4
(in contrast toSYS_accept4
👀) is taken from thelinux/net.h
header.Also note that the
socketcall
syscall takes all arguments as array of long ints. I've double checked withglibc
to check how they pass arguments, since the Linux man page only says this: "args points to a block containing the actual arguments" and "only standard library implementors and kernel hackers need to know about socketcall()".This should fix rust-lang/rust#82400