Skip to content

Commit

Permalink
Add support for GNU/Hurd
Browse files Browse the repository at this point in the history
  • Loading branch information
sthibaul committed Jun 29, 2024
1 parent 6616fb6 commit d03bae3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -663,7 +664,10 @@ impl<T: AsRawSocket> 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;
Expand Down
2 changes: 2 additions & 0 deletions src/socket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit d03bae3

Please sign in to comment.