summary refs log tree commit diff
diff options
context:
space:
mode:
authorMaarten de Vries <maarten@de-vri.es>2021-02-24 13:25:36 +0100
committerMaarten de Vries <maarten@de-vri.es>2021-02-24 13:37:27 +0100
commit695b048aecfdc76df3ecad2bd2d047116e65074e (patch)
tree854cccdb5e9a3b51c6e6a3c3688b0b70557e0d43
parentb631c914cdb5b74dac8f182ca96fdfd3e03ab319 (diff)
downloadrust-695b048aecfdc76df3ecad2bd2d047116e65074e.tar.gz
rust-695b048aecfdc76df3ecad2bd2d047116e65074e.zip
Disable use of accept4 on x86 Android.
On x86 before Linux 4.3, accept4 is not a separate syscall.
Instead, it can be called using `socketcall(SYS_ACCEPT4, ...).
Rather than implementing that here, just fall back to `accept`.
-rw-r--r--library/std/src/sys/unix/net.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/library/std/src/sys/unix/net.rs b/library/std/src/sys/unix/net.rs
index 7198a2f08d6..1df90c18c7c 100644
--- a/library/std/src/sys/unix/net.rs
+++ b/library/std/src/sys/unix/net.rs
@@ -208,7 +208,7 @@ impl Socket {
                 Ok(Socket(FileDesc::new(fd)))
             // While the Android kernel supports the syscall,
             // it is not included in all versions of Android's libc.
-            } else if #[cfg(target_os = "android")] {
+            } else if #[cfg(all(target_os = "android", not(target_arch = "x86")))] {
                 let fd = cvt_r(|| unsafe {
                     libc::syscall(libc::SYS_accept4, self.0.raw(), storage, len, libc::SOCK_CLOEXEC)
                 })?;