From d03bae3b7ce52f81a0bca5797926aabde3cd7dca Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Sat, 29 Jun 2024 20:09:55 +0200 Subject: [PATCH] Add support for GNU/Hurd --- src/ext.rs | 6 +++++- src/socket.rs | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/ext.rs b/src/ext.rs index d6d32a5..83dcf31 100644 --- a/src/ext.rs +++ b/src/ext.rs @@ -24,6 +24,7 @@ cfg_if! { if #[cfg(any(target_os = "dragonfly", target_os = "freebsd", target_os = "haiku", + target_os = "hurd", target_os = "ios", target_os = "macos", target_os = "netbsd", @@ -663,7 +664,10 @@ impl AsSock for T { cfg_if! { if #[cfg(any(target_os = "macos", target_os = "ios", target_os = "nto"))] { use libc::TCP_KEEPALIVE as KEEPALIVE_OPTION; - } else if #[cfg(any(target_os = "haiku", target_os = "netbsd", target_os = "openbsd"))] { + } else if #[cfg(any(target_os = "haiku", + target_os = "hurd", + target_os = "netbsd", + target_os = "openbsd"))] { use libc::SO_KEEPALIVE as KEEPALIVE_OPTION; } else if #[cfg(unix)] { use libc::TCP_KEEPIDLE as KEEPALIVE_OPTION; diff --git a/src/socket.rs b/src/socket.rs index ab0bdeb..1efde3d 100644 --- a/src/socket.rs +++ b/src/socket.rs @@ -125,6 +125,7 @@ fn addr2raw_v4(addr: &SocketAddrV4) -> (SocketAddrCRepr, c::socklen_t) { #[cfg(any( target_os = "dragonfly", target_os = "freebsd", + target_os = "hurd", target_os = "ios", target_os = "macos", target_os = "netbsd", @@ -175,6 +176,7 @@ fn addr2raw_v6(addr: &SocketAddrV6) -> (SocketAddrCRepr, c::socklen_t) { #[cfg(any( target_os = "dragonfly", target_os = "freebsd", + target_os = "hurd", target_os = "ios", target_os = "macos", target_os = "netbsd",