Enable file locking support for Hurd
authorFabian Grünbichler <f.gruenbichler@proxmox.com>
Tue, 16 Dec 2025 10:45:36 +0000 (11:45 +0100)
committerFabian Grünbichler <debian@fabian.gruenbichler.email>
Fri, 26 Dec 2025 19:54:51 +0000 (20:54 +0100)
like Illumos in #148322, Hurd was missed when originally introducing locking
gates per target OS in #132977. building rustc on Hurd was broken as a result
since 1.91.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Gbp-Pq: Topic upstream
Gbp-Pq: Name Enable-file-locking-support-for-Hurd.patch

library/std/src/fs/tests.rs
library/std/src/sys/fs/unix.rs

index c4e56bc8916773395a0c6f9768bf873ffb14a319..2fa02dab262999622c0f926be6c43afc85e26f51 100644 (file)
@@ -226,6 +226,7 @@ fn file_test_io_seek_and_write() {
 #[cfg(any(
     windows,
     target_os = "freebsd",
+    target_is = "hurd",
     target_os = "linux",
     target_os = "netbsd",
     target_os = "solaris",
@@ -251,6 +252,7 @@ fn file_lock_multiple_shared() {
 #[cfg(any(
     windows,
     target_os = "freebsd",
+    target_is = "hurd",
     target_os = "linux",
     target_os = "netbsd",
     target_os = "solaris",
@@ -277,6 +279,7 @@ fn file_lock_blocking() {
 #[cfg(any(
     windows,
     target_os = "freebsd",
+    target_is = "hurd",
     target_os = "linux",
     target_os = "netbsd",
     target_os = "solaris",
@@ -300,6 +303,7 @@ fn file_lock_drop() {
 #[cfg(any(
     windows,
     target_os = "freebsd",
+    target_os = "hurd",
     target_os = "linux",
     target_os = "netbsd",
     target_os = "solaris",
index af8b297186848222dba3c651df3a3918dc56a84b..84f997154a5e08d0d254ce839c890b61600434d6 100644 (file)
@@ -1282,6 +1282,7 @@ impl File {
     #[cfg(any(
         target_os = "freebsd",
         target_os = "fuchsia",
+        target_os = "hurd",
         target_os = "linux",
         target_os = "netbsd",
         target_os = "openbsd",
@@ -1306,6 +1307,7 @@ impl File {
     #[cfg(not(any(
         target_os = "freebsd",
         target_os = "fuchsia",
+        target_os = "hurd",
         target_os = "linux",
         target_os = "netbsd",
         target_os = "openbsd",
@@ -1321,6 +1323,7 @@ impl File {
     #[cfg(any(
         target_os = "freebsd",
         target_os = "fuchsia",
+        target_os = "hurd",
         target_os = "linux",
         target_os = "netbsd",
         target_os = "openbsd",
@@ -1345,6 +1348,7 @@ impl File {
     #[cfg(not(any(
         target_os = "freebsd",
         target_os = "fuchsia",
+        target_os = "hurd",
         target_os = "linux",
         target_os = "netbsd",
         target_os = "openbsd",
@@ -1360,6 +1364,7 @@ impl File {
     #[cfg(any(
         target_os = "freebsd",
         target_os = "fuchsia",
+        target_os = "hurd",
         target_os = "linux",
         target_os = "netbsd",
         target_os = "openbsd",
@@ -1400,6 +1405,7 @@ impl File {
     #[cfg(not(any(
         target_os = "freebsd",
         target_os = "fuchsia",
+        target_os = "hurd",
         target_os = "linux",
         target_os = "netbsd",
         target_os = "openbsd",
@@ -1418,6 +1424,7 @@ impl File {
     #[cfg(any(
         target_os = "freebsd",
         target_os = "fuchsia",
+        target_os = "hurd",
         target_os = "linux",
         target_os = "netbsd",
         target_os = "openbsd",
@@ -1458,6 +1465,7 @@ impl File {
     #[cfg(not(any(
         target_os = "freebsd",
         target_os = "fuchsia",
+        target_os = "hurd",
         target_os = "linux",
         target_os = "netbsd",
         target_os = "openbsd",
@@ -1476,6 +1484,7 @@ impl File {
     #[cfg(any(
         target_os = "freebsd",
         target_os = "fuchsia",
+        target_os = "hurd",
         target_os = "linux",
         target_os = "netbsd",
         target_os = "openbsd",
@@ -1500,6 +1509,7 @@ impl File {
     #[cfg(not(any(
         target_os = "freebsd",
         target_os = "fuchsia",
+        target_os = "hurd",
         target_os = "linux",
         target_os = "netbsd",
         target_os = "openbsd",