Rollup merge of #119742 - Meziu:armv6k-nintendo-3ds, r=Mark-Simulacrum

ARMv6K HorizonOS - Fix backlog for UnixListener

Simple `#[cfg]` fix to avoid using `libc::SOMAXCONN`, which isn't defined for the `armv6k-nintendo-3ds` target.

Edit: This is similar to #119632.
This commit is contained in:
Guillaume Gomez 2024-01-14 20:17:23 +01:00 committed by GitHub
commit e401754717
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -73,7 +73,12 @@ impl UnixListener {
unsafe {
let inner = Socket::new_raw(libc::AF_UNIX, libc::SOCK_STREAM)?;
let (addr, len) = sockaddr_un(path.as_ref())?;
#[cfg(any(target_os = "windows", target_os = "redox", target_os = "espidf"))]
#[cfg(any(
target_os = "windows",
target_os = "redox",
target_os = "espidf",
target_os = "horizon"
))]
const backlog: libc::c_int = 128;
#[cfg(any(target_os = "linux", target_os = "freebsd", target_os = "openbsd"))]
const backlog: libc::c_int = -1;
@ -83,7 +88,8 @@ impl UnixListener {
target_os = "linux",
target_os = "freebsd",
target_os = "openbsd",
target_os = "espidf"
target_os = "espidf",
target_os = "horizon"
)))]
const backlog: libc::c_int = libc::SOMAXCONN;