summary refs log tree commit diff
path: root/library/std/src/sys_common
diff options
context:
space:
mode:
authorMeziu <meziu210@icloud.com>2021-10-19 17:59:59 +0200
committerMark Drobnak <mark.drobnak@gmail.com>2022-06-13 20:44:39 -0700
commit4e808f87ccb706d339c9ea10c3c9a9c9fd7fc6cb (patch)
treefe1be89ab4da7ec631c4c4d7bd6f824d95c29da4 /library/std/src/sys_common
parent3bdec3c8abdc48e46715d7b14b764af28da1cee3 (diff)
downloadrust-4e808f87ccb706d339c9ea10c3c9a9c9fd7fc6cb.tar.gz
rust-4e808f87ccb706d339c9ea10c3c9a9c9fd7fc6cb.zip
Horizon OS STD support
Co-authored-by: Ian Chamberlain <ian.h.chamberlain@gmail.com>
Co-authored-by: Mark Drobnak <mark.drobnak@gmail.com>
Diffstat (limited to 'library/std/src/sys_common')
-rw-r--r--library/std/src/sys_common/net.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/library/std/src/sys_common/net.rs b/library/std/src/sys_common/net.rs
index 05425f4a362..7498e61d3d0 100644
--- a/library/std/src/sys_common/net.rs
+++ b/library/std/src/sys_common/net.rs
@@ -399,7 +399,12 @@ impl TcpListener {
         cvt(unsafe { c::bind(sock.as_raw(), addrp, len as _) })?;
 
         // Start listening
+        #[cfg(not(target_os = "horizon"))]
         cvt(unsafe { c::listen(sock.as_raw(), 128) })?;
+        // 40 is the maximum for Horizon OS
+        #[cfg(target_os = "horizon")]
+        cvt(unsafe { c::listen(sock.as_raw(), 40) })?;
+
         Ok(TcpListener { inner: sock })
     }