Skip to content

Commit

Permalink
Add GNU/Hurd support
Browse files Browse the repository at this point in the history
  • Loading branch information
sthibaul committed Nov 5, 2023
1 parent 5c8bf8c commit 595ee33
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ targets = ["aarch64-apple-ios", "aarch64-linux-android", "x86_64-apple-darwin",
features = ["all"]

[target."cfg(unix)".dependencies]
libc = "0.2.149"
libc = "0.2.150"

[target.'cfg(windows)'.dependencies.windows-sys]
version = "0.48"
Expand Down
8 changes: 8 additions & 0 deletions src/socket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -760,6 +760,7 @@ const fn set_common_type(ty: Type) -> Type {
target_os = "dragonfly",
target_os = "freebsd",
target_os = "fuchsia",
target_os = "hurd",
target_os = "illumos",
target_os = "linux",
target_os = "netbsd",
Expand All @@ -786,6 +787,7 @@ fn set_common_flags(socket: Socket) -> io::Result<Socket> {
target_os = "dragonfly",
target_os = "freebsd",
target_os = "fuchsia",
target_os = "hurd",
target_os = "illumos",
target_os = "linux",
target_os = "netbsd",
Expand Down Expand Up @@ -1307,6 +1309,7 @@ impl Socket {
#[cfg(not(any(
target_os = "dragonfly",
target_os = "haiku",
target_os = "hurd",
target_os = "netbsd",
target_os = "openbsd",
target_os = "redox",
Expand Down Expand Up @@ -1344,6 +1347,7 @@ impl Socket {
#[cfg(not(any(
target_os = "dragonfly",
target_os = "haiku",
target_os = "hurd",
target_os = "netbsd",
target_os = "openbsd",
target_os = "redox",
Expand Down Expand Up @@ -1523,6 +1527,7 @@ impl Socket {
target_os = "aix",
target_os = "dragonfly",
target_os = "fuchsia",
target_os = "hurd",
target_os = "illumos",
target_os = "netbsd",
target_os = "openbsd",
Expand Down Expand Up @@ -1553,6 +1558,7 @@ impl Socket {
target_os = "aix",
target_os = "dragonfly",
target_os = "fuchsia",
target_os = "hurd",
target_os = "illumos",
target_os = "netbsd",
target_os = "openbsd",
Expand Down Expand Up @@ -1777,6 +1783,7 @@ impl Socket {
target_os = "redox",
target_os = "solaris",
target_os = "haiku",
target_os = "hurd",
target_os = "espidf",
target_os = "vita",
)))]
Expand All @@ -1801,6 +1808,7 @@ impl Socket {
target_os = "redox",
target_os = "solaris",
target_os = "haiku",
target_os = "hurd",
target_os = "espidf",
target_os = "vita",
)))]
Expand Down
8 changes: 8 additions & 0 deletions src/sys/unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down Expand Up @@ -180,6 +182,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",
Expand Down Expand Up @@ -330,6 +333,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",
Expand Down Expand Up @@ -430,6 +434,7 @@ impl Type {
target_os = "dragonfly",
target_os = "freebsd",
target_os = "fuchsia",
target_os = "hurd",
target_os = "illumos",
target_os = "linux",
target_os = "netbsd",
Expand All @@ -447,6 +452,7 @@ impl Type {
target_os = "dragonfly",
target_os = "freebsd",
target_os = "fuchsia",
target_os = "hurd",
target_os = "illumos",
target_os = "linux",
target_os = "netbsd",
Expand All @@ -465,6 +471,7 @@ impl Type {
target_os = "dragonfly",
target_os = "freebsd",
target_os = "fuchsia",
target_os = "hurd",
target_os = "illumos",
target_os = "linux",
target_os = "netbsd",
Expand Down Expand Up @@ -1181,6 +1188,7 @@ pub(crate) fn set_tcp_keepalive(fd: Socket, keepalive: &TcpKeepalive) -> io::Res
target_os = "dragonfly",
target_os = "freebsd",
target_os = "fuchsia",
target_os = "hurd",
target_os = "illumos",
target_os = "ios",
target_os = "linux",
Expand Down
4 changes: 4 additions & 0 deletions tests/socket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,7 @@ fn set_cloexec() {
target_os = "dragonfly",
target_os = "freebsd",
target_os = "fuchsia",
target_os = "hurd",
target_os = "linux",
target_os = "netbsd",
target_os = "openbsd"
Expand Down Expand Up @@ -1396,6 +1397,7 @@ test!(IPv4 tos, set_tos(96));
#[cfg(not(any(
target_os = "dragonfly",
target_os = "fuchsia",
target_os = "hurd",
target_os = "illumos",
target_os = "netbsd",
target_os = "openbsd",
Expand Down Expand Up @@ -1442,6 +1444,7 @@ test!(IPv6 tclass_v6, set_tclass_v6(96));
#[cfg(not(any(
target_os = "dragonfly",
target_os = "fuchsia",
target_os = "hurd",
target_os = "illumos",
target_os = "netbsd",
target_os = "openbsd",
Expand Down Expand Up @@ -1495,6 +1498,7 @@ fn join_leave_multicast_v4_n() {
#[cfg(not(any(
target_os = "dragonfly",
target_os = "haiku",
target_os = "hurd",
target_os = "netbsd",
target_os = "openbsd",
target_os = "redox",
Expand Down

0 comments on commit 595ee33

Please sign in to comment.