We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 51c0db6 commit 743eb65Copy full SHA for 743eb65
library/std/src/os/unix/net/listener.rs
@@ -74,7 +74,15 @@ 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 if cfg!(target_os = "redox") {
80
+ // redox's relibc defines as 128
81
+ // FIXME: adding to libc's crate
82
+ 128
83
+ } else {
84
+ libc::SOMAXCONN
85
+ };
86
87
cvt(libc::bind(inner.as_inner().as_raw_fd(), &addr as *const _ as *const _, len as _))?;
88
cvt(libc::listen(inner.as_inner().as_raw_fd(), backlog))?;
0 commit comments