Skip to content

Commit 4d25f46

Browse files
committed
Auto merge of rust-lang#82476 - de-vri-es:beta-android-x86-accept4, r=joshtriplett
[beta] Fix TcpListener::accept() on x86 Android on beta by disabling the use of accept4. This is the same as rust-lang#82475, but for beta. In a nutshell: `TcpListener::accept` is broken on Android x86 on stable and beta because it performs a raw `accept4` syscall, which doesn't exist on that platform. This was originally reported in rust-lang#82400, so you can find more details there. `@rustbot` label +O-android r? `@Mark-Simulacrum`
2 parents b631c91 + 695b048 commit 4d25f46

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)