From 24cff1ffee753d26db77025a41c8ac13c0b1afe6 Mon Sep 17 00:00:00 2001 From: Jonathan Krebs Date: Mon, 15 Apr 2024 22:56:08 +0200 Subject: [PATCH 1/8] add solarish and freebsd to O_SEARCH, as it exists in in the libc crate --- src/fcntl.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fcntl.rs b/src/fcntl.rs index 16af6e6d86..803acb21cc 100644 --- a/src/fcntl.rs +++ b/src/fcntl.rs @@ -165,7 +165,7 @@ libc_bitflags!( #[cfg(any(target_os = "linux", netbsdlike))] O_RSYNC; /// Skip search permission checks. - #[cfg(target_os = "netbsd")] + #[cfg(any(target_os = "netbsd"), freebsd, solarish)] O_SEARCH; /// Open with a shared file lock. #[cfg(any(bsd, target_os = "redox"))] From 02d0e918eeb072511a8730b3e7ec6b4020d10aa5 Mon Sep 17 00:00:00 2001 From: Jonathan Krebs Date: Mon, 15 Apr 2024 23:07:50 +0200 Subject: [PATCH 2/8] fcntl/O_SEARCH: add description similiar to the posix manpage --- src/fcntl.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/fcntl.rs b/src/fcntl.rs index 803acb21cc..2d89e851b0 100644 --- a/src/fcntl.rs +++ b/src/fcntl.rs @@ -164,7 +164,8 @@ libc_bitflags!( /// Similar to `O_DSYNC` but applies to `read`s instead. #[cfg(any(target_os = "linux", netbsdlike))] O_RSYNC; - /// Skip search permission checks. + /// Open directory for search only. Skip search permission checks on + /// later `openat()` calls using the obtained file descriptor. #[cfg(any(target_os = "netbsd"), freebsd, solarish)] O_SEARCH; /// Open with a shared file lock. From cfe3f9d31e6e87627bc7a25c2342031cbd7c811a Mon Sep 17 00:00:00 2001 From: Jonathan Krebs Date: Mon, 15 Apr 2024 23:14:07 +0200 Subject: [PATCH 3/8] fcntl O_SEARCH oops - fix syntax --- src/fcntl.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fcntl.rs b/src/fcntl.rs index 2d89e851b0..75a9b49107 100644 --- a/src/fcntl.rs +++ b/src/fcntl.rs @@ -166,7 +166,7 @@ libc_bitflags!( O_RSYNC; /// Open directory for search only. Skip search permission checks on /// later `openat()` calls using the obtained file descriptor. - #[cfg(any(target_os = "netbsd"), freebsd, solarish)] + #[cfg(any(target_os = "netbsd", freebsd, solarish))] O_SEARCH; /// Open with a shared file lock. #[cfg(any(bsd, target_os = "redox"))] From 268847add97671f46775468ddb3e2a40e53b8762 Mon Sep 17 00:00:00 2001 From: Jonathan Krebs Date: Mon, 15 Apr 2024 23:20:54 +0200 Subject: [PATCH 4/8] fcntl O_SEARCH: add fuchsia --- src/fcntl.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fcntl.rs b/src/fcntl.rs index 75a9b49107..ff371b3534 100644 --- a/src/fcntl.rs +++ b/src/fcntl.rs @@ -166,7 +166,7 @@ libc_bitflags!( O_RSYNC; /// Open directory for search only. Skip search permission checks on /// later `openat()` calls using the obtained file descriptor. - #[cfg(any(target_os = "netbsd", freebsd, solarish))] + #[cfg(any(target_os = "netbsd", freebsd, solarish, target_os = "fuchsia"))] O_SEARCH; /// Open with a shared file lock. #[cfg(any(bsd, target_os = "redox"))] From 30b8ffe5c948cb1993bdd425d7fc88e80c8cab9a Mon Sep 17 00:00:00 2001 From: Jonathan Krebs Date: Mon, 15 Apr 2024 23:23:13 +0200 Subject: [PATCH 5/8] O_SEARCH: changelog --- changelog/2374.added.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog/2374.added.md diff --git a/changelog/2374.added.md b/changelog/2374.added.md new file mode 100644 index 0000000000..b2e1dd10a6 --- /dev/null +++ b/changelog/2374.added.md @@ -0,0 +1 @@ +Add `open` flag `O_SEARCH` to FreeBSD, solarish, Fuchsia From eaab07b1537fe894934f11cd396c67de12f6a20d Mon Sep 17 00:00:00 2001 From: TheJonny Date: Tue, 16 Apr 2024 07:28:36 +0200 Subject: [PATCH 6/8] fcntl/OPath: no alias for single platform Co-authored-by: SteveLauC --- src/fcntl.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fcntl.rs b/src/fcntl.rs index ff371b3534..5e28ece256 100644 --- a/src/fcntl.rs +++ b/src/fcntl.rs @@ -166,7 +166,7 @@ libc_bitflags!( O_RSYNC; /// Open directory for search only. Skip search permission checks on /// later `openat()` calls using the obtained file descriptor. - #[cfg(any(target_os = "netbsd", freebsd, solarish, target_os = "fuchsia"))] + #[cfg(any(target_os = "netbsd", target_os = "freebsd", solarish, target_os = "fuchsia"))] O_SEARCH; /// Open with a shared file lock. #[cfg(any(bsd, target_os = "redox"))] From 4af9ec85f463b3f3717a1874b8e3c44f96816e10 Mon Sep 17 00:00:00 2001 From: Jonathan Krebs Date: Sun, 21 Apr 2024 15:10:13 +0200 Subject: [PATCH 7/8] O_SEARCH: also add aux, wasi, emscripten --- src/fcntl.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fcntl.rs b/src/fcntl.rs index 5e28ece256..a33b2642d3 100644 --- a/src/fcntl.rs +++ b/src/fcntl.rs @@ -166,7 +166,7 @@ libc_bitflags!( O_RSYNC; /// Open directory for search only. Skip search permission checks on /// later `openat()` calls using the obtained file descriptor. - #[cfg(any(target_os = "netbsd", target_os = "freebsd", solarish, target_os = "fuchsia"))] + #[cfg(any(target_os = "netbsd", target_os = "freebsd", solarish, target_os = "fuchsia", target_os = "emscripten", target_os = "aix", target_os = "wasi"))] O_SEARCH; /// Open with a shared file lock. #[cfg(any(bsd, target_os = "redox"))] From e025b56848d6952918b0458952e023a4aaf30b73 Mon Sep 17 00:00:00 2001 From: Jonathan Krebs Date: Sun, 21 Apr 2024 15:22:34 +0200 Subject: [PATCH 8/8] O_SEARCH: updated added platforms in changelog --- changelog/2374.added.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog/2374.added.md b/changelog/2374.added.md index b2e1dd10a6..ed0ed25675 100644 --- a/changelog/2374.added.md +++ b/changelog/2374.added.md @@ -1 +1 @@ -Add `open` flag `O_SEARCH` to FreeBSD, solarish, Fuchsia +Add `open` flag `O_SEARCH` to AIX, Empscripten, FreeBSD, Fuchsia, solarish, WASI