Skip to content

Commit

Permalink
Unrolled build for rust-lang#119943
Browse files Browse the repository at this point in the history
Rollup merge of rust-lang#119943 - devnexen:listener_update3, r=thomcc

std::net: bind update for using backlog as `-1` too.

Albeit not documented, macOs also support negative value for the backlog argument.

ref: https://github.com/apple/darwin-xnu/blob/2ff845c2e033bd0ff64b5b6aa6063a1f8f65aa32/bsd/kern/uipc_socket.c#L1061
  • Loading branch information
rust-timer authored Jan 22, 2024
2 parents 3066253 + 89cf177 commit 9ddd0f1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion library/std/src/os/unix/net/listener.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,20 @@ impl UnixListener {
target_os = "horizon"
))]
const backlog: libc::c_int = 128;
#[cfg(any(target_os = "linux", target_os = "freebsd", target_os = "openbsd"))]
#[cfg(any(
target_os = "linux",
target_os = "freebsd",
target_os = "openbsd",
target_os = "macos"
))]
const backlog: libc::c_int = -1;
#[cfg(not(any(
target_os = "windows",
target_os = "redox",
target_os = "linux",
target_os = "freebsd",
target_os = "openbsd",
target_os = "macos",
target_os = "espidf",
target_os = "horizon"
)))]
Expand Down

0 comments on commit 9ddd0f1

Please sign in to comment.