Skip to content

Commit 60a7cab

Browse files
committed
Use fstatat() in DirEntry::metadata on Apple platforms
1 parent e821cb8 commit 60a7cab

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ use libc::c_char;
1414
target_os = "fuchsia",
1515
target_os = "hurd",
1616
target_os = "illumos",
17+
target_vendor = "apple",
1718
))]
1819
use libc::dirfd;
19-
#[cfg(any(target_os = "fuchsia", target_os = "illumos"))]
20+
#[cfg(any(target_os = "fuchsia", target_os = "illumos", target_vendor = "apple")]
2021
use libc::fstatat as fstatat64;
2122
#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "hurd"))]
2223
use libc::fstatat64;
@@ -907,6 +908,7 @@ impl DirEntry {
907908
target_os = "fuchsia",
908909
target_os = "hurd",
909910
target_os = "illumos",
911+
target_vendor = "apple",
910912
),
911913
not(miri) // no dirfd on Miri
912914
))]
@@ -937,6 +939,7 @@ impl DirEntry {
937939
target_os = "fuchsia",
938940
target_os = "hurd",
939941
target_os = "illumos",
942+
target_vendor = "apple",
940943
)),
941944
miri
942945
))]

0 commit comments

Comments
 (0)