From ec667cadfa27a79ea4b011b163bbbdc6603bc9a8 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Tue, 29 Aug 2023 20:03:20 +0000 Subject: [PATCH] Add GNU/Hurd support --- .github/workflows/main.yml | 4 ++-- src/socket.rs | 6 ++++++ src/sys/unix.rs | 6 ++++++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index febf9fcc..e340b07e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -71,7 +71,7 @@ jobs: strategy: fail-fast: false matrix: - target: ["armv7-sony-vita-newlibeabihf"] + target: ["armv7-sony-vita-newlibeabihf", "i686-unknown-hurd-gnu"] steps: - uses: actions/checkout@v3 - uses: dtolnay/rust-toolchain@nightly @@ -108,7 +108,7 @@ jobs: strategy: fail-fast: false matrix: - target: ["armv7-sony-vita-newlibeabihf"] + target: ["armv7-sony-vita-newlibeabihf", "i686-unknown-hurd-gnu"] steps: - uses: actions/checkout@v3 - uses: dtolnay/rust-toolchain@nightly # NOTE: need nightly for `doc_cfg` feature. diff --git a/src/socket.rs b/src/socket.rs index efe2b0a4..e7ff04af 100644 --- a/src/socket.rs +++ b/src/socket.rs @@ -1307,6 +1307,7 @@ impl Socket { #[cfg(not(any( target_os = "dragonfly", target_os = "haiku", + target_os = "hurd", target_os = "netbsd", target_os = "openbsd", target_os = "redox", @@ -1344,6 +1345,7 @@ impl Socket { #[cfg(not(any( target_os = "dragonfly", target_os = "haiku", + target_os = "hurd", target_os = "netbsd", target_os = "openbsd", target_os = "redox", @@ -1521,6 +1523,7 @@ impl Socket { target_os = "aix", target_os = "dragonfly", target_os = "fuchsia", + target_os = "hurd", target_os = "illumos", target_os = "netbsd", target_os = "openbsd", @@ -1551,6 +1554,7 @@ impl Socket { target_os = "aix", target_os = "dragonfly", target_os = "fuchsia", + target_os = "hurd", target_os = "illumos", target_os = "netbsd", target_os = "openbsd", @@ -1775,6 +1779,7 @@ impl Socket { target_os = "redox", target_os = "solaris", target_os = "haiku", + target_os = "hurd", target_os = "espidf", target_os = "vita", )))] @@ -1799,6 +1804,7 @@ impl Socket { target_os = "redox", target_os = "solaris", target_os = "haiku", + target_os = "hurd", target_os = "espidf", target_os = "vita", )))] diff --git a/src/sys/unix.rs b/src/sys/unix.rs index c5626003..a3373486 100644 --- a/src/sys/unix.rs +++ b/src/sys/unix.rs @@ -121,6 +121,7 @@ pub(crate) use libc::ipv6_mreq as Ipv6Mreq; #[cfg(not(any( target_os = "dragonfly", target_os = "fuchsia", + target_os = "hurd", target_os = "illumos", target_os = "netbsd", target_os = "openbsd", @@ -143,6 +144,7 @@ pub(crate) use libc::IP_HDRINCL; target_os = "redox", target_os = "solaris", target_os = "haiku", + target_os = "hurd", target_os = "nto", target_os = "espidf", target_os = "vita", @@ -179,6 +181,7 @@ pub(crate) use libc::{ #[cfg(not(any( target_os = "dragonfly", target_os = "haiku", + target_os = "hurd", target_os = "netbsd", target_os = "openbsd", target_os = "redox", @@ -329,6 +332,7 @@ type IovLen = usize; target_os = "freebsd", target_os = "fuchsia", target_os = "haiku", + target_os = "hurd", target_os = "illumos", target_os = "ios", target_os = "macos", @@ -446,6 +450,7 @@ impl Type { target_os = "dragonfly", target_os = "freebsd", target_os = "fuchsia", + target_os = "hurd", target_os = "illumos", target_os = "linux", target_os = "netbsd", @@ -464,6 +469,7 @@ impl Type { target_os = "dragonfly", target_os = "freebsd", target_os = "fuchsia", + target_os = "hurd", target_os = "illumos", target_os = "linux", target_os = "netbsd",