Skip to content

Commit 595ee33

Browse files
committed
Add GNU/Hurd support
1 parent 5c8bf8c commit 595ee33

File tree

5 files changed

+23
-3
lines changed

5 files changed

+23
-3
lines changed

.github/workflows/main.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ jobs:
7171
strategy:
7272
fail-fast: false
7373
matrix:
74-
target: ["armv7-sony-vita-newlibeabihf"]
74+
target: ["armv7-sony-vita-newlibeabihf", "i686-unknown-hurd-gnu"]
7575
steps:
7676
- uses: actions/checkout@v3
7777
- uses: dtolnay/rust-toolchain@nightly
@@ -108,7 +108,7 @@ jobs:
108108
strategy:
109109
fail-fast: false
110110
matrix:
111-
target: ["armv7-sony-vita-newlibeabihf"]
111+
target: ["armv7-sony-vita-newlibeabihf", "i686-unknown-hurd-gnu"]
112112
steps:
113113
- uses: actions/checkout@v3
114114
- uses: dtolnay/rust-toolchain@nightly # NOTE: need nightly for `doc_cfg` feature.

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ targets = ["aarch64-apple-ios", "aarch64-linux-android", "x86_64-apple-darwin",
3535
features = ["all"]
3636

3737
[target."cfg(unix)".dependencies]
38-
libc = "0.2.149"
38+
libc = "0.2.150"
3939

4040
[target.'cfg(windows)'.dependencies.windows-sys]
4141
version = "0.48"

src/socket.rs

+8
Original file line numberDiff line numberDiff line change
@@ -760,6 +760,7 @@ const fn set_common_type(ty: Type) -> Type {
760760
target_os = "dragonfly",
761761
target_os = "freebsd",
762762
target_os = "fuchsia",
763+
target_os = "hurd",
763764
target_os = "illumos",
764765
target_os = "linux",
765766
target_os = "netbsd",
@@ -786,6 +787,7 @@ fn set_common_flags(socket: Socket) -> io::Result<Socket> {
786787
target_os = "dragonfly",
787788
target_os = "freebsd",
788789
target_os = "fuchsia",
790+
target_os = "hurd",
789791
target_os = "illumos",
790792
target_os = "linux",
791793
target_os = "netbsd",
@@ -1307,6 +1309,7 @@ impl Socket {
13071309
#[cfg(not(any(
13081310
target_os = "dragonfly",
13091311
target_os = "haiku",
1312+
target_os = "hurd",
13101313
target_os = "netbsd",
13111314
target_os = "openbsd",
13121315
target_os = "redox",
@@ -1344,6 +1347,7 @@ impl Socket {
13441347
#[cfg(not(any(
13451348
target_os = "dragonfly",
13461349
target_os = "haiku",
1350+
target_os = "hurd",
13471351
target_os = "netbsd",
13481352
target_os = "openbsd",
13491353
target_os = "redox",
@@ -1523,6 +1527,7 @@ impl Socket {
15231527
target_os = "aix",
15241528
target_os = "dragonfly",
15251529
target_os = "fuchsia",
1530+
target_os = "hurd",
15261531
target_os = "illumos",
15271532
target_os = "netbsd",
15281533
target_os = "openbsd",
@@ -1553,6 +1558,7 @@ impl Socket {
15531558
target_os = "aix",
15541559
target_os = "dragonfly",
15551560
target_os = "fuchsia",
1561+
target_os = "hurd",
15561562
target_os = "illumos",
15571563
target_os = "netbsd",
15581564
target_os = "openbsd",
@@ -1777,6 +1783,7 @@ impl Socket {
17771783
target_os = "redox",
17781784
target_os = "solaris",
17791785
target_os = "haiku",
1786+
target_os = "hurd",
17801787
target_os = "espidf",
17811788
target_os = "vita",
17821789
)))]
@@ -1801,6 +1808,7 @@ impl Socket {
18011808
target_os = "redox",
18021809
target_os = "solaris",
18031810
target_os = "haiku",
1811+
target_os = "hurd",
18041812
target_os = "espidf",
18051813
target_os = "vita",
18061814
)))]

src/sys/unix.rs

+8
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ pub(crate) use libc::ipv6_mreq as Ipv6Mreq;
121121
#[cfg(not(any(
122122
target_os = "dragonfly",
123123
target_os = "fuchsia",
124+
target_os = "hurd",
124125
target_os = "illumos",
125126
target_os = "netbsd",
126127
target_os = "openbsd",
@@ -143,6 +144,7 @@ pub(crate) use libc::IP_HDRINCL;
143144
target_os = "redox",
144145
target_os = "solaris",
145146
target_os = "haiku",
147+
target_os = "hurd",
146148
target_os = "nto",
147149
target_os = "espidf",
148150
target_os = "vita",
@@ -180,6 +182,7 @@ pub(crate) use libc::{
180182
#[cfg(not(any(
181183
target_os = "dragonfly",
182184
target_os = "haiku",
185+
target_os = "hurd",
183186
target_os = "netbsd",
184187
target_os = "openbsd",
185188
target_os = "redox",
@@ -330,6 +333,7 @@ type IovLen = usize;
330333
target_os = "freebsd",
331334
target_os = "fuchsia",
332335
target_os = "haiku",
336+
target_os = "hurd",
333337
target_os = "illumos",
334338
target_os = "ios",
335339
target_os = "macos",
@@ -430,6 +434,7 @@ impl Type {
430434
target_os = "dragonfly",
431435
target_os = "freebsd",
432436
target_os = "fuchsia",
437+
target_os = "hurd",
433438
target_os = "illumos",
434439
target_os = "linux",
435440
target_os = "netbsd",
@@ -447,6 +452,7 @@ impl Type {
447452
target_os = "dragonfly",
448453
target_os = "freebsd",
449454
target_os = "fuchsia",
455+
target_os = "hurd",
450456
target_os = "illumos",
451457
target_os = "linux",
452458
target_os = "netbsd",
@@ -465,6 +471,7 @@ impl Type {
465471
target_os = "dragonfly",
466472
target_os = "freebsd",
467473
target_os = "fuchsia",
474+
target_os = "hurd",
468475
target_os = "illumos",
469476
target_os = "linux",
470477
target_os = "netbsd",
@@ -1181,6 +1188,7 @@ pub(crate) fn set_tcp_keepalive(fd: Socket, keepalive: &TcpKeepalive) -> io::Res
11811188
target_os = "dragonfly",
11821189
target_os = "freebsd",
11831190
target_os = "fuchsia",
1191+
target_os = "hurd",
11841192
target_os = "illumos",
11851193
target_os = "ios",
11861194
target_os = "linux",

tests/socket.rs

+4
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,7 @@ fn set_cloexec() {
348348
target_os = "dragonfly",
349349
target_os = "freebsd",
350350
target_os = "fuchsia",
351+
target_os = "hurd",
351352
target_os = "linux",
352353
target_os = "netbsd",
353354
target_os = "openbsd"
@@ -1396,6 +1397,7 @@ test!(IPv4 tos, set_tos(96));
13961397
#[cfg(not(any(
13971398
target_os = "dragonfly",
13981399
target_os = "fuchsia",
1400+
target_os = "hurd",
13991401
target_os = "illumos",
14001402
target_os = "netbsd",
14011403
target_os = "openbsd",
@@ -1442,6 +1444,7 @@ test!(IPv6 tclass_v6, set_tclass_v6(96));
14421444
#[cfg(not(any(
14431445
target_os = "dragonfly",
14441446
target_os = "fuchsia",
1447+
target_os = "hurd",
14451448
target_os = "illumos",
14461449
target_os = "netbsd",
14471450
target_os = "openbsd",
@@ -1495,6 +1498,7 @@ fn join_leave_multicast_v4_n() {
14951498
#[cfg(not(any(
14961499
target_os = "dragonfly",
14971500
target_os = "haiku",
1501+
target_os = "hurd",
14981502
target_os = "netbsd",
14991503
target_os = "openbsd",
15001504
target_os = "redox",

0 commit comments

Comments
 (0)