diff --git a/Cargo.toml b/Cargo.toml index 7ecb6eea0c7..6ed579b136d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,4 +30,5 @@ unexpected_cfgs = { level = "warn", check-cfg = [ 'cfg(tokio_taskdump)', 'cfg(tokio_unstable)', 'cfg(tokio_uring)', + 'cfg(target_os, values("cygwin"))', ] } diff --git a/tokio/src/net/tcp/socket.rs b/tokio/src/net/tcp/socket.rs index 340e8e89a60..9dc1ec9e9b8 100644 --- a/tokio/src/net/tcp/socket.rs +++ b/tokio/src/net/tcp/socket.rs @@ -276,10 +276,20 @@ impl TcpSocket { /// Ok(()) /// } /// ``` - #[cfg(all(unix, not(target_os = "solaris"), not(target_os = "illumos")))] + #[cfg(all( + unix, + not(target_os = "solaris"), + not(target_os = "illumos"), + not(target_os = "cygwin"), + ))] #[cfg_attr( docsrs, - doc(cfg(all(unix, not(target_os = "solaris"), not(target_os = "illumos")))) + doc(cfg(all( + unix, + not(target_os = "solaris"), + not(target_os = "illumos"), + not(target_os = "cygwin"), + ))) )] pub fn set_reuseport(&self, reuseport: bool) -> io::Result<()> { self.inner.set_reuse_port(reuseport) @@ -311,10 +321,20 @@ impl TcpSocket { /// Ok(()) /// } /// ``` - #[cfg(all(unix, not(target_os = "solaris"), not(target_os = "illumos")))] + #[cfg(all( + unix, + not(target_os = "solaris"), + not(target_os = "illumos"), + not(target_os = "cygwin"), + ))] #[cfg_attr( docsrs, - doc(cfg(all(unix, not(target_os = "solaris"), not(target_os = "illumos")))) + doc(cfg(all( + unix, + not(target_os = "solaris"), + not(target_os = "illumos"), + not(target_os = "cygwin"), + ))) )] pub fn reuseport(&self) -> io::Result { self.inner.reuse_port() diff --git a/tokio/src/net/unix/ucred.rs b/tokio/src/net/unix/ucred.rs index 74e596bc9b6..bdc417f1304 100644 --- a/tokio/src/net/unix/ucred.rs +++ b/tokio/src/net/unix/ucred.rs @@ -36,7 +36,8 @@ impl UCred { target_os = "redox", target_os = "android", target_os = "openbsd", - target_os = "haiku" + target_os = "haiku", + target_os = "cygwin" ))] pub(crate) use self::impl_linux::get_peer_cred; @@ -69,7 +70,8 @@ pub(crate) use self::impl_noproc::get_peer_cred; target_os = "redox", target_os = "android", target_os = "openbsd", - target_os = "haiku" + target_os = "haiku", + target_os = "cygwin" ))] pub(crate) mod impl_linux { use crate::net::unix::{self, UnixStream}; @@ -83,7 +85,8 @@ pub(crate) mod impl_linux { target_os = "linux", target_os = "redox", target_os = "android", - target_os = "haiku" + target_os = "haiku", + target_os = "cygwin" ))] use libc::ucred;