Skip to content

Commit 695b048

Browse files
committed
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`.
1 parent b631c91 commit 695b048

File tree

1 file changed

+1
-1
lines changed
  • library/std/src/sys/unix

1 file changed

+1
-1
lines changed

library/std/src/sys/unix/net.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ impl Socket {
208208
Ok(Socket(FileDesc::new(fd)))
209209
// While the Android kernel supports the syscall,
210210
// it is not included in all versions of Android's libc.
211-
} else if #[cfg(target_os = "android")] {
211+
} else if #[cfg(all(target_os = "android", not(target_arch = "x86")))] {
212212
let fd = cvt_r(|| unsafe {
213213
libc::syscall(libc::SYS_accept4, self.0.raw(), storage, len, libc::SOCK_CLOEXEC)
214214
})?;

0 commit comments

Comments
 (0)