We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 57ad505 + f5c3967 commit cf5c1d8Copy full SHA for cf5c1d8
library/std/src/os/unix/net/listener.rs
@@ -74,7 +74,11 @@ impl UnixListener {
74
let inner = Socket::new_raw(libc::AF_UNIX, libc::SOCK_STREAM)?;
75
let (addr, len) = sockaddr_un(path.as_ref())?;
76
const backlog: libc::c_int =
77
- if cfg!(any(target_os = "linux", target_os = "freebsd")) { -1 } else { 128 };
+ if cfg!(any(target_os = "linux", target_os = "freebsd", target_os = "openbsd")) {
78
+ -1
79
+ } else {
80
+ libc::SOMAXCONN
81
+ };
82
83
cvt(libc::bind(inner.as_inner().as_raw_fd(), &addr as *const _ as *const _, len as _))?;
84
cvt(libc::listen(inner.as_inner().as_raw_fd(), backlog))?;
0 commit comments