about summary refs log tree commit diff
path: root/library/std/src/sys/net/connection/socket/unix.rs
diff options
context:
space:
mode:
authorTrevor Gross <t.gross35@gmail.com>2025-09-06 14:39:04 -0400
committerGitHub <noreply@github.com>2025-09-06 14:39:04 -0400
commit31d7cbc3710148e6eb3cd9854c5dfdfa7e76b783 (patch)
treee48a4db6c14dbd5abc8dd410fe05b7c8c79adfe5 /library/std/src/sys/net/connection/socket/unix.rs
parentbea625f3275e3c897dc965ed97a1d19ef7831f01 (diff)
parent26b157572280d058c8a800e4888f4b37062eb533 (diff)
downloadrust-31d7cbc3710148e6eb3cd9854c5dfdfa7e76b783.tar.gz
rust-31d7cbc3710148e6eb3cd9854c5dfdfa7e76b783.zip
Rollup merge of #139524 - Berrysoft:cygwin-socket-ext, r=tgross35
Add socket extensions for cygwin

r? `@joboet`

* Abstract name uds addr
* quickack
* passcred
Diffstat (limited to 'library/std/src/sys/net/connection/socket/unix.rs')
-rw-r--r--library/std/src/sys/net/connection/socket/unix.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/library/std/src/sys/net/connection/socket/unix.rs b/library/std/src/sys/net/connection/socket/unix.rs
index 8b5970d1494..8216f8d2fd5 100644
--- a/library/std/src/sys/net/connection/socket/unix.rs
+++ b/library/std/src/sys/net/connection/socket/unix.rs
@@ -361,7 +361,7 @@ impl Socket {
         self.recv_from_with_flags(buf, 0)
     }
 
-    #[cfg(any(target_os = "android", target_os = "linux"))]
+    #[cfg(any(target_os = "android", target_os = "linux", target_os = "cygwin"))]
     pub fn recv_msg(&self, msg: &mut libc::msghdr) -> io::Result<usize> {
         let n = cvt(unsafe { libc::recvmsg(self.as_raw_fd(), msg, libc::MSG_CMSG_CLOEXEC) })?;
         Ok(n as usize)
@@ -384,7 +384,7 @@ impl Socket {
         self.0.is_write_vectored()
     }
 
-    #[cfg(any(target_os = "android", target_os = "linux"))]
+    #[cfg(any(target_os = "android", target_os = "linux", target_os = "cygwin"))]
     pub fn send_msg(&self, msg: &mut libc::msghdr) -> io::Result<usize> {
         let n = cvt(unsafe { libc::sendmsg(self.as_raw_fd(), msg, 0) })?;
         Ok(n as usize)
@@ -472,12 +472,12 @@ impl Socket {
         Ok(raw != 0)
     }
 
-    #[cfg(any(target_os = "android", target_os = "linux",))]
+    #[cfg(any(target_os = "android", target_os = "linux", target_os = "cygwin"))]
     pub fn set_quickack(&self, quickack: bool) -> io::Result<()> {
         setsockopt(self, libc::IPPROTO_TCP, libc::TCP_QUICKACK, quickack as c_int)
     }
 
-    #[cfg(any(target_os = "android", target_os = "linux",))]
+    #[cfg(any(target_os = "android", target_os = "linux", target_os = "cygwin"))]
     pub fn quickack(&self) -> io::Result<bool> {
         let raw: c_int = getsockopt(self, libc::IPPROTO_TCP, libc::TCP_QUICKACK)?;
         Ok(raw != 0)
@@ -541,12 +541,12 @@ impl Socket {
         Ok(raw != 0)
     }
 
-    #[cfg(any(target_os = "android", target_os = "linux",))]
+    #[cfg(any(target_os = "android", target_os = "linux", target_os = "cygwin"))]
     pub fn set_passcred(&self, passcred: bool) -> io::Result<()> {
         setsockopt(self, libc::SOL_SOCKET, libc::SO_PASSCRED, passcred as libc::c_int)
     }
 
-    #[cfg(any(target_os = "android", target_os = "linux",))]
+    #[cfg(any(target_os = "android", target_os = "linux", target_os = "cygwin"))]
     pub fn passcred(&self) -> io::Result<bool> {
         let passcred: libc::c_int = getsockopt(self, libc::SOL_SOCKET, libc::SO_PASSCRED)?;
         Ok(passcred != 0)