Skip to content

Commit 3deaa18

Browse files
committed
rework *at imports
1 parent c8b411f commit 3deaa18

File tree

1 file changed

+26
-8
lines changed

1 file changed

+26
-8
lines changed

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

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,7 @@ use libc::{c_int, mode_t};
5454
#[cfg(target_os = "android")]
5555
use libc::{
5656
dirent as dirent64, fstat as fstat64, fstatat as fstatat64, ftruncate64, lseek64,
57-
lstat as lstat64, mkdirat, off64_t, open as open64, openat as openat64, renameat,
58-
stat as stat64, unlinkat,
57+
lstat as lstat64, off64_t, open as open64, stat as stat64,
5958
};
6059
#[cfg(not(any(
6160
all(target_os = "linux", not(target_env = "musl")),
@@ -65,18 +64,37 @@ use libc::{
6564
)))]
6665
use libc::{
6766
dirent as dirent64, fstat as fstat64, ftruncate as ftruncate64, lseek as lseek64,
68-
lstat as lstat64, mkdirat, off_t as off64_t, open as open64, openat as openat64, renameat,
69-
stat as stat64, unlinkat,
67+
lstat as lstat64, off_t as off64_t, open as open64, stat as stat64,
7068
};
7169
#[cfg(any(
7270
all(target_os = "linux", not(target_env = "musl")),
7371
target_os = "l4re",
7472
target_os = "hurd"
7573
))]
76-
use libc::{
77-
dirent64, fstat64, ftruncate64, lseek64, lstat64, mkdirat, off64_t, open64, openat64, renameat,
78-
stat64, unlinkat,
79-
};
74+
use libc::{dirent64, fstat64, ftruncate64, lseek64, lstat64, off64_t, open64, stat64};
75+
#[cfg(any(
76+
target_os = "aix",
77+
target_os = "freebsd",
78+
target_os = "fuchsia",
79+
target_os = "solaris",
80+
target_vendor = "apple",
81+
))]
82+
use libc::{mkdirat, openat as openat64, renameat, unlinkat};
83+
#[cfg(not(any(
84+
target_os = "redox",
85+
target_os = "espidf",
86+
target_os = "horizon",
87+
target_os = "vita",
88+
target_os = "nto",
89+
target_os = "vxworks",
90+
target_os = "fuchsia",
91+
target_os = "freebsd",
92+
target_os = "solaris",
93+
target_os = "aix",
94+
target_vendor = "apple",
95+
miri
96+
)))]
97+
use libc::{mkdirat, openat64, renameat, unlinkat};
8098

8199
#[cfg(any(target_os = "freebsd", target_os = "aix"))]
82100
const TRAVERSE_DIRECTORY: i32 = libc::O_EXEC;

0 commit comments

Comments
 (0)