Skip to content

Commit

Permalink
Auto merge of rust-lang#82476 - de-vri-es:beta-android-x86-accept4, r…
Browse files Browse the repository at this point in the history
…=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`
  • Loading branch information
bors committed Mar 5, 2021
2 parents b631c91 + 695b048 commit 4d25f46
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion library/std/src/sys/unix/net.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})?;
Expand Down

0 comments on commit 4d25f46

Please sign in to comment.