about summary refs log tree commit diff
path: root/library/std/src/os/unix/net/addr.rs
diff options
context:
space:
mode:
authorBerrysoft <Strawberry_Str@hotmail.com>2025-04-08 18:07:43 +0800
committer王宇逸 <Strawberry_Str@hotmail.com>2025-09-06 20:23:37 +0800
commit26b157572280d058c8a800e4888f4b37062eb533 (patch)
tree8e7921065c22180a8c8112b04e3271070c9e651b /library/std/src/os/unix/net/addr.rs
parent577166503aee7290e09374da21f4045c455acfd5 (diff)
downloadrust-26b157572280d058c8a800e4888f4b37062eb533.tar.gz
rust-26b157572280d058c8a800e4888f4b37062eb533.zip
Add socket extensions for cygwin
Diffstat (limited to 'library/std/src/os/unix/net/addr.rs')
-rw-r--r--library/std/src/os/unix/net/addr.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/library/std/src/os/unix/net/addr.rs b/library/std/src/os/unix/net/addr.rs
index fd6fe72dd24..25b95014e08 100644
--- a/library/std/src/os/unix/net/addr.rs
+++ b/library/std/src/os/unix/net/addr.rs
@@ -1,6 +1,6 @@
 use crate::bstr::ByteStr;
 use crate::ffi::OsStr;
-#[cfg(any(doc, target_os = "android", target_os = "linux"))]
+#[cfg(any(doc, target_os = "android", target_os = "linux", target_os = "cygwin"))]
 use crate::os::net::linux_ext;
 use crate::os::unix::ffi::OsStrExt;
 use crate::path::Path;
@@ -241,7 +241,7 @@ impl SocketAddr {
 
         // macOS seems to return a len of 16 and a zeroed sun_path for unnamed addresses
         if len == 0
-            || (cfg!(not(any(target_os = "linux", target_os = "android")))
+            || (cfg!(not(any(target_os = "linux", target_os = "android", target_os = "cygwin")))
                 && self.addr.sun_path[0] == 0)
         {
             AddressKind::Unnamed
@@ -256,8 +256,8 @@ impl SocketAddr {
 #[stable(feature = "unix_socket_abstract", since = "1.70.0")]
 impl Sealed for SocketAddr {}
 
-#[doc(cfg(any(target_os = "android", target_os = "linux")))]
-#[cfg(any(doc, target_os = "android", target_os = "linux"))]
+#[doc(cfg(any(target_os = "android", target_os = "linux", target_os = "cygwin")))]
+#[cfg(any(doc, target_os = "android", target_os = "linux", target_os = "cygwin"))]
 #[stable(feature = "unix_socket_abstract", since = "1.70.0")]
 impl linux_ext::addr::SocketAddrExt for SocketAddr {
     fn as_abstract_name(&self) -> Option<&[u8]> {