Skip to content

Commit dcb29c5

Browse files
authored
Remove internal usage of use ...::syscalls::*. (#198)
Remove lines like > pub(crate) use super::fs::syscalls::*; from the top-level syscalls.rs files, and just have code reference the specific modules they need.
1 parent 847dae6 commit dcb29c5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+217
-254
lines changed

src/fs/abs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@ use imp::fs::StatFs;
2929
)))]
3030
#[inline]
3131
pub fn statfs<P: path::Arg>(path: P) -> io::Result<StatFs> {
32-
path.into_with_z_str(|path| imp::syscalls::statfs(path))
32+
path.into_with_z_str(|path| imp::fs::syscalls::statfs(path))
3333
}

src/fs/at.rs

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ pub fn openat<P: path::Arg, Fd: AsFd>(
4646
create_mode: Mode,
4747
) -> io::Result<OwnedFd> {
4848
let dirfd = dirfd.as_fd();
49-
path.into_with_z_str(|path| imp::syscalls::openat(dirfd, path, oflags, create_mode))
49+
path.into_with_z_str(|path| imp::fs::syscalls::openat(dirfd, path, oflags, create_mode))
5050
}
5151

5252
/// `readlinkat(fd, path)`—Reads the contents of a symlink.
@@ -78,7 +78,7 @@ fn _readlinkat(dirfd: BorrowedFd<'_>, path: &ZStr, mut buffer: Vec<u8>) -> io::R
7878
buffer.resize(buffer.capacity(), 0_u8);
7979

8080
loop {
81-
let nread = imp::syscalls::readlinkat(dirfd, path, &mut buffer)?;
81+
let nread = imp::fs::syscalls::readlinkat(dirfd, path, &mut buffer)?;
8282

8383
let nread = nread as usize;
8484
assert!(nread <= buffer.len());
@@ -102,7 +102,7 @@ fn _readlinkat(dirfd: BorrowedFd<'_>, path: &ZStr, mut buffer: Vec<u8>) -> io::R
102102
#[inline]
103103
pub fn mkdirat<P: path::Arg, Fd: AsFd>(dirfd: &Fd, path: P, mode: Mode) -> io::Result<()> {
104104
let dirfd = dirfd.as_fd();
105-
path.into_with_z_str(|path| imp::syscalls::mkdirat(dirfd, path, mode))
105+
path.into_with_z_str(|path| imp::fs::syscalls::mkdirat(dirfd, path, mode))
106106
}
107107

108108
/// `linkat(old_dirfd, old_path, new_dirfd, new_path, flags)`—Creates a hard
@@ -126,7 +126,7 @@ pub fn linkat<P: path::Arg, Q: path::Arg, PFd: AsFd, QFd: AsFd>(
126126
let new_dirfd = new_dirfd.as_fd();
127127
old_path.into_with_z_str(|old_path| {
128128
new_path.into_with_z_str(|new_path| {
129-
imp::syscalls::linkat(old_dirfd, old_path, new_dirfd, new_path, flags)
129+
imp::fs::syscalls::linkat(old_dirfd, old_path, new_dirfd, new_path, flags)
130130
})
131131
})
132132
}
@@ -146,7 +146,7 @@ pub fn linkat<P: path::Arg, Q: path::Arg, PFd: AsFd, QFd: AsFd>(
146146
#[inline]
147147
pub fn unlinkat<P: path::Arg, Fd: AsFd>(dirfd: &Fd, path: P, flags: AtFlags) -> io::Result<()> {
148148
let dirfd = dirfd.as_fd();
149-
path.into_with_z_str(|path| imp::syscalls::unlinkat(dirfd, path, flags))
149+
path.into_with_z_str(|path| imp::fs::syscalls::unlinkat(dirfd, path, flags))
150150
}
151151

152152
/// `renameat(old_dirfd, old_path, new_dirfd, new_path)`—Renames a file or
@@ -169,7 +169,7 @@ pub fn renameat<P: path::Arg, Q: path::Arg, PFd: AsFd, QFd: AsFd>(
169169
let new_dirfd = new_dirfd.as_fd();
170170
old_path.into_with_z_str(|old_path| {
171171
new_path.into_with_z_str(|new_path| {
172-
imp::syscalls::renameat(old_dirfd, old_path, new_dirfd, new_path)
172+
imp::fs::syscalls::renameat(old_dirfd, old_path, new_dirfd, new_path)
173173
})
174174
})
175175
}
@@ -195,7 +195,7 @@ pub fn renameat_with<P: path::Arg, Q: path::Arg, PFd: AsFd, QFd: AsFd>(
195195
let new_dirfd = new_dirfd.as_fd();
196196
old_path.into_with_z_str(|old_path| {
197197
new_path.into_with_z_str(|new_path| {
198-
imp::syscalls::renameat2(old_dirfd, old_path, new_dirfd, new_path, flags)
198+
imp::fs::syscalls::renameat2(old_dirfd, old_path, new_dirfd, new_path, flags)
199199
})
200200
})
201201
}
@@ -216,7 +216,8 @@ pub fn symlinkat<P: path::Arg, Q: path::Arg, Fd: AsFd>(
216216
) -> io::Result<()> {
217217
let new_dirfd = new_dirfd.as_fd();
218218
old_path.into_with_z_str(|old_path| {
219-
new_path.into_with_z_str(|new_path| imp::syscalls::symlinkat(old_path, new_dirfd, new_path))
219+
new_path
220+
.into_with_z_str(|new_path| imp::fs::syscalls::symlinkat(old_path, new_dirfd, new_path))
220221
})
221222
}
222223

@@ -237,7 +238,7 @@ pub fn symlinkat<P: path::Arg, Q: path::Arg, Fd: AsFd>(
237238
#[doc(alias = "fstatat")]
238239
pub fn statat<P: path::Arg, Fd: AsFd>(dirfd: &Fd, path: P, flags: AtFlags) -> io::Result<Stat> {
239240
let dirfd = dirfd.as_fd();
240-
path.into_with_z_str(|path| imp::syscalls::statat(dirfd, path, flags))
241+
path.into_with_z_str(|path| imp::fs::syscalls::statat(dirfd, path, flags))
241242
}
242243

243244
/// `faccessat(dirfd, path, access, flags)`—Tests permissions for a file or
@@ -259,7 +260,7 @@ pub fn accessat<P: path::Arg, Fd: AsFd>(
259260
flags: AtFlags,
260261
) -> io::Result<()> {
261262
let dirfd = dirfd.as_fd();
262-
path.into_with_z_str(|path| imp::syscalls::accessat(dirfd, path, access, flags))
263+
path.into_with_z_str(|path| imp::fs::syscalls::accessat(dirfd, path, access, flags))
263264
}
264265

265266
/// `utimensat(dirfd, path, times, flags)`—Sets file or directory timestamps.
@@ -278,7 +279,7 @@ pub fn utimensat<P: path::Arg, Fd: AsFd>(
278279
flags: AtFlags,
279280
) -> io::Result<()> {
280281
let dirfd = dirfd.as_fd();
281-
path.into_with_z_str(|path| imp::syscalls::utimensat(dirfd, path, times, flags))
282+
path.into_with_z_str(|path| imp::fs::syscalls::utimensat(dirfd, path, times, flags))
282283
}
283284

284285
/// `fchmodat(dirfd, path, mode, 0)`—Sets file or directory permissions.
@@ -300,7 +301,7 @@ pub fn utimensat<P: path::Arg, Fd: AsFd>(
300301
#[doc(alias = "fchmodat")]
301302
pub fn chmodat<P: path::Arg, Fd: AsFd>(dirfd: &Fd, path: P, mode: Mode) -> io::Result<()> {
302303
let dirfd = dirfd.as_fd();
303-
path.into_with_z_str(|path| imp::syscalls::chmodat(dirfd, path, mode))
304+
path.into_with_z_str(|path| imp::fs::syscalls::chmodat(dirfd, path, mode))
304305
}
305306

306307
/// `fclonefileat(src, dst_dir, dst, flags)`—Efficiently copies between files.
@@ -320,7 +321,7 @@ pub fn fclonefileat<Fd: AsFd, DstFd: AsFd, P: path::Arg>(
320321
let srcfd = src.as_fd();
321322
let dst_dirfd = dst_dir.as_fd();
322323
dst.into_with_z_str(|dst| {
323-
imp::syscalls::fclonefileat(srcfd.as_fd(), dst_dirfd.as_fd(), &dst, flags)
324+
imp::fs::syscalls::fclonefileat(srcfd.as_fd(), dst_dirfd.as_fd(), &dst, flags)
324325
})
325326
}
326327

@@ -342,7 +343,7 @@ pub fn mknodat<P: path::Arg, Fd: AsFd>(
342343
dev: Dev,
343344
) -> io::Result<()> {
344345
let dirfd = dirfd.as_fd();
345-
path.into_with_z_str(|path| imp::syscalls::mknodat(dirfd, path, file_type, mode, dev))
346+
path.into_with_z_str(|path| imp::fs::syscalls::mknodat(dirfd, path, file_type, mode, dev))
346347
}
347348

348349
/// `fchownat(dirfd, path, owner, group, flags)`—Sets file or directory
@@ -364,5 +365,5 @@ pub fn chownat<P: path::Arg, Fd: AsFd>(
364365
flags: AtFlags,
365366
) -> io::Result<()> {
366367
let dirfd = dirfd.as_fd();
367-
path.into_with_z_str(|path| imp::syscalls::chownat(dirfd, path, owner, group, flags))
368+
path.into_with_z_str(|path| imp::fs::syscalls::chownat(dirfd, path, owner, group, flags))
368369
}

src/fs/copy_file_range.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ pub fn copy_file_range<InFd: AsFd, OutFd: AsFd>(
1818
) -> io::Result<u64> {
1919
let fd_in = fd_in.as_fd();
2020
let fd_out = fd_out.as_fd();
21-
imp::syscalls::copy_file_range(fd_in, off_in, fd_out, off_out, len)
21+
imp::fs::syscalls::copy_file_range(fd_in, off_in, fd_out, off_out, len)
2222
}

src/fs/fadvise.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ pub use imp::fs::Advice;
1616
#[doc(alias = "posix_fadvise")]
1717
pub fn fadvise<Fd: AsFd>(fd: &Fd, offset: u64, len: u64, advice: Advice) -> io::Result<()> {
1818
let fd = fd.as_fd();
19-
imp::syscalls::fadvise(fd, offset, len, advice)
19+
imp::fs::syscalls::fadvise(fd, offset, len, advice)
2020
}

src/fs/fcntl.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use imp::fs::{FdFlags, OFlags};
2020
#[doc(alias = "F_GETFD")]
2121
pub fn fcntl_getfd<Fd: AsFd>(fd: &Fd) -> io::Result<FdFlags> {
2222
let fd = fd.as_fd();
23-
imp::syscalls::fcntl_getfd(fd)
23+
imp::fs::syscalls::fcntl_getfd(fd)
2424
}
2525

2626
/// `fcntl(fd, F_SETFD, flags)`—Sets a file descriptor's flags.
@@ -35,7 +35,7 @@ pub fn fcntl_getfd<Fd: AsFd>(fd: &Fd) -> io::Result<FdFlags> {
3535
#[doc(alias = "F_SETFD")]
3636
pub fn fcntl_setfd<Fd: AsFd>(fd: &Fd, flags: FdFlags) -> io::Result<()> {
3737
let fd = fd.as_fd();
38-
imp::syscalls::fcntl_setfd(fd, flags)
38+
imp::fs::syscalls::fcntl_setfd(fd, flags)
3939
}
4040

4141
/// `fcntl(fd, F_GETFL)`—Returns a file descriptor's access mode and status.
@@ -50,7 +50,7 @@ pub fn fcntl_setfd<Fd: AsFd>(fd: &Fd, flags: FdFlags) -> io::Result<()> {
5050
#[doc(alias = "F_GETFL")]
5151
pub fn fcntl_getfl<Fd: AsFd>(fd: &Fd) -> io::Result<OFlags> {
5252
let fd = fd.as_fd();
53-
imp::syscalls::fcntl_getfl(fd)
53+
imp::fs::syscalls::fcntl_getfl(fd)
5454
}
5555

5656
/// `fcntl(fd, F_SETFL, flags)`—Sets a file descriptor's status.
@@ -65,7 +65,7 @@ pub fn fcntl_getfl<Fd: AsFd>(fd: &Fd) -> io::Result<OFlags> {
6565
#[doc(alias = "F_SETFL")]
6666
pub fn fcntl_setfl<Fd: AsFd>(fd: &Fd, flags: OFlags) -> io::Result<()> {
6767
let fd = fd.as_fd();
68-
imp::syscalls::fcntl_setfl(fd, flags)
68+
imp::fs::syscalls::fcntl_setfl(fd, flags)
6969
}
7070

7171
/// `fcntl(fd, F_GET_SEALS)`
@@ -84,7 +84,7 @@ pub fn fcntl_setfl<Fd: AsFd>(fd: &Fd, flags: OFlags) -> io::Result<()> {
8484
#[doc(alias = "F_GET_SEALS")]
8585
pub fn fcntl_get_seals<Fd: AsFd>(fd: &Fd) -> io::Result<SealFlags> {
8686
let fd = fd.as_fd();
87-
imp::syscalls::fcntl_get_seals(fd)
87+
imp::fs::syscalls::fcntl_get_seals(fd)
8888
}
8989

9090
#[cfg(any(
@@ -111,7 +111,7 @@ pub use imp::fs::SealFlags;
111111
#[doc(alias = "F_ADD_SEALS")]
112112
pub fn fcntl_add_seals<Fd: AsFd>(fd: &Fd, seals: SealFlags) -> io::Result<()> {
113113
let fd = fd.as_fd();
114-
imp::syscalls::fcntl_add_seals(fd, seals)
114+
imp::fs::syscalls::fcntl_add_seals(fd, seals)
115115
}
116116

117117
/// `fcntl(fd, F_DUPFD_CLOEXEC)`—Creates a new `OwnedFd` instance, with value
@@ -134,5 +134,5 @@ pub fn fcntl_add_seals<Fd: AsFd>(fd: &Fd, seals: SealFlags) -> io::Result<()> {
134134
#[doc(alias = "F_DUPFD_CLOEXEC")]
135135
pub fn fcntl_dupfd_cloexec<Fd: AsFd>(fd: &Fd, min: RawFd) -> io::Result<OwnedFd> {
136136
let fd = fd.as_fd();
137-
imp::syscalls::fcntl_dupfd_cloexec(fd, min)
137+
imp::fs::syscalls::fcntl_dupfd_cloexec(fd, min)
138138
}

src/fs/fcntl_darwin.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use imp::fd::AsFd;
1010
#[inline]
1111
pub fn fcntl_rdadvise<Fd: AsFd>(fd: &Fd, offset: u64, len: u64) -> io::Result<()> {
1212
let fd = fd.as_fd();
13-
imp::syscalls::fcntl_rdadvise(fd, offset, len)
13+
imp::fs::syscalls::fcntl_rdadvise(fd, offset, len)
1414
}
1515

1616
/// `fcntl(fd, F_FULLFSYNC)`
@@ -22,5 +22,5 @@ pub fn fcntl_rdadvise<Fd: AsFd>(fd: &Fd, offset: u64, len: u64) -> io::Result<()
2222
#[inline]
2323
pub fn fcntl_fullfsync<Fd: AsFd>(fd: &Fd) -> io::Result<()> {
2424
let fd = fd.as_fd();
25-
imp::syscalls::fcntl_fullfsync(fd)
25+
imp::fs::syscalls::fcntl_fullfsync(fd)
2626
}

src/fs/fcopyfile.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ pub unsafe fn fcopyfile<FromFd: AsFd, ToFd: AsFd>(
2525
) -> io::Result<()> {
2626
let from = from.as_fd();
2727
let to = to.as_fd();
28-
imp::syscalls::fcopyfile(from, to, state, flags)
28+
imp::fs::syscalls::fcopyfile(from, to, state, flags)
2929
}
3030

3131
/// `copyfile_state_alloc()`
@@ -36,7 +36,7 @@ pub unsafe fn fcopyfile<FromFd: AsFd, ToFd: AsFd>(
3636
/// [Apple]: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man3/fcopyfile.3.html
3737
#[inline]
3838
pub fn copyfile_state_alloc() -> io::Result<copyfile_state_t> {
39-
imp::syscalls::copyfile_state_alloc()
39+
imp::fs::syscalls::copyfile_state_alloc()
4040
}
4141

4242
/// `copyfile_state_free(state)`
@@ -52,7 +52,7 @@ pub fn copyfile_state_alloc() -> io::Result<copyfile_state_t> {
5252
/// [Apple]: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man3/fcopyfile.3.html
5353
#[inline]
5454
pub unsafe fn copyfile_state_free(state: copyfile_state_t) -> io::Result<()> {
55-
imp::syscalls::copyfile_state_free(state)
55+
imp::fs::syscalls::copyfile_state_free(state)
5656
}
5757

5858
/// `copyfile_state_get(state, COPYFILE_STATE_COPIED)`
@@ -68,7 +68,7 @@ pub unsafe fn copyfile_state_free(state: copyfile_state_t) -> io::Result<()> {
6868
/// [Apple]: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man3/fcopyfile.3.html
6969
#[inline]
7070
pub unsafe fn copyfile_state_get_copied(state: copyfile_state_t) -> io::Result<u64> {
71-
imp::syscalls::copyfile_state_get_copied(state)
71+
imp::fs::syscalls::copyfile_state_get_copied(state)
7272
}
7373

7474
/// `copyfile_state_get(state, flags, dst)`
@@ -88,5 +88,5 @@ pub unsafe fn copyfile_state_get(
8888
flag: u32,
8989
dst: *mut core::ffi::c_void,
9090
) -> io::Result<()> {
91-
imp::syscalls::copyfile_state_get(state, flag, dst)
91+
imp::fs::syscalls::copyfile_state_get(state, flag, dst)
9292
}

src/fs/fd.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ use imp::fs::{FlockOperation, Mode};
3737
#[inline]
3838
pub fn seek<Fd: AsFd>(fd: &Fd, pos: SeekFrom) -> io::Result<u64> {
3939
let fd = fd.as_fd();
40-
imp::syscalls::seek(fd, pos)
40+
imp::fs::syscalls::seek(fd, pos)
4141
}
4242

4343
/// `lseek(fd, 0, SEEK_CUR)`—Returns the current position within a file.
@@ -55,7 +55,7 @@ pub fn seek<Fd: AsFd>(fd: &Fd, pos: SeekFrom) -> io::Result<u64> {
5555
#[inline]
5656
pub fn tell<Fd: AsFd>(fd: &Fd) -> io::Result<u64> {
5757
let fd = fd.as_fd();
58-
imp::syscalls::tell(fd)
58+
imp::fs::syscalls::tell(fd)
5959
}
6060

6161
/// `fchmod(fd)`—Sets open file or directory permissions.
@@ -73,7 +73,7 @@ pub fn tell<Fd: AsFd>(fd: &Fd) -> io::Result<u64> {
7373
#[inline]
7474
pub fn fchmod<Fd: AsFd>(fd: &Fd, mode: Mode) -> io::Result<()> {
7575
let fd = fd.as_fd();
76-
imp::syscalls::fchmod(fd, mode)
76+
imp::fs::syscalls::fchmod(fd, mode)
7777
}
7878

7979
/// `fchown(fd)`—Sets open file or directory ownership.
@@ -88,7 +88,7 @@ pub fn fchmod<Fd: AsFd>(fd: &Fd, mode: Mode) -> io::Result<()> {
8888
#[inline]
8989
pub fn fchown<Fd: AsFd>(fd: &Fd, owner: Uid, group: Gid) -> io::Result<()> {
9090
let fd = fd.as_fd();
91-
imp::syscalls::fchown(fd, owner, group)
91+
imp::fs::syscalls::fchown(fd, owner, group)
9292
}
9393

9494
/// `fstat(fd)`—Queries metadata for an open file or directory.
@@ -107,7 +107,7 @@ pub fn fchown<Fd: AsFd>(fd: &Fd, owner: Uid, group: Gid) -> io::Result<()> {
107107
#[inline]
108108
pub fn fstat<Fd: AsFd>(fd: &Fd) -> io::Result<Stat> {
109109
let fd = fd.as_fd();
110-
imp::syscalls::fstat(fd)
110+
imp::fs::syscalls::fstat(fd)
111111
}
112112

113113
/// `fstatfs(fd)`—Queries filesystem statistics for an open file or directory.
@@ -125,7 +125,7 @@ pub fn fstat<Fd: AsFd>(fd: &Fd) -> io::Result<Stat> {
125125
#[inline]
126126
pub fn fstatfs<Fd: AsFd>(fd: &Fd) -> io::Result<StatFs> {
127127
let fd = fd.as_fd();
128-
imp::syscalls::fstatfs(fd)
128+
imp::fs::syscalls::fstatfs(fd)
129129
}
130130

131131
/// `futimens(fd, times)`—Sets timestamps for an open file or directory.
@@ -139,7 +139,7 @@ pub fn fstatfs<Fd: AsFd>(fd: &Fd) -> io::Result<StatFs> {
139139
#[inline]
140140
pub fn futimens<Fd: AsFd>(fd: &Fd, times: &Timestamps) -> io::Result<()> {
141141
let fd = fd.as_fd();
142-
imp::syscalls::futimens(fd, times)
142+
imp::fs::syscalls::futimens(fd, times)
143143
}
144144

145145
/// `fallocate(fd, mode, offset, len)`—Adjusts file allocation.
@@ -168,7 +168,7 @@ pub fn futimens<Fd: AsFd>(fd: &Fd, times: &Timestamps) -> io::Result<()> {
168168
#[doc(alias = "posix_fallocate")]
169169
pub fn fallocate<Fd: AsFd>(fd: &Fd, mode: FallocateFlags, offset: u64, len: u64) -> io::Result<()> {
170170
let fd = fd.as_fd();
171-
imp::syscalls::fallocate(fd, mode, offset, len)
171+
imp::fs::syscalls::fallocate(fd, mode, offset, len)
172172
}
173173

174174
/// `fcntl(fd, F_GETFL) & O_ACCMODE`
@@ -184,7 +184,7 @@ pub fn is_file_read_write<Fd: AsFd>(fd: &Fd) -> io::Result<(bool, bool)> {
184184
}
185185

186186
pub(crate) fn _is_file_read_write(fd: BorrowedFd<'_>) -> io::Result<(bool, bool)> {
187-
let mode = imp::syscalls::fcntl_getfl(fd)?;
187+
let mode = imp::fs::syscalls::fcntl_getfl(fd)?;
188188

189189
// Check for `O_PATH`.
190190
#[cfg(any(
@@ -223,7 +223,7 @@ pub(crate) fn _is_file_read_write(fd: BorrowedFd<'_>) -> io::Result<(bool, bool)
223223
#[inline]
224224
pub fn fsync<Fd: AsFd>(fd: &Fd) -> io::Result<()> {
225225
let fd = fd.as_fd();
226-
imp::syscalls::fsync(fd)
226+
imp::fs::syscalls::fsync(fd)
227227
}
228228

229229
/// `fdatasync(fd)`—Ensures that file data is written to the underlying
@@ -244,7 +244,7 @@ pub fn fsync<Fd: AsFd>(fd: &Fd) -> io::Result<()> {
244244
#[inline]
245245
pub fn fdatasync<Fd: AsFd>(fd: &Fd) -> io::Result<()> {
246246
let fd = fd.as_fd();
247-
imp::syscalls::fdatasync(fd)
247+
imp::fs::syscalls::fdatasync(fd)
248248
}
249249

250250
/// `ftruncate(fd, length)`—Sets the length of a file.
@@ -258,7 +258,7 @@ pub fn fdatasync<Fd: AsFd>(fd: &Fd) -> io::Result<()> {
258258
#[inline]
259259
pub fn ftruncate<Fd: AsFd>(fd: &Fd, length: u64) -> io::Result<()> {
260260
let fd = fd.as_fd();
261-
imp::syscalls::ftruncate(fd, length)
261+
imp::fs::syscalls::ftruncate(fd, length)
262262
}
263263

264264
/// `flock(fd, operation)`—Acquire or release an advisory lock on an open file.
@@ -271,5 +271,5 @@ pub fn ftruncate<Fd: AsFd>(fd: &Fd, length: u64) -> io::Result<()> {
271271
#[inline]
272272
pub fn flock<Fd: AsFd>(fd: &Fd, operation: FlockOperation) -> io::Result<()> {
273273
let fd = fd.as_fd();
274-
imp::syscalls::flock(fd, operation)
274+
imp::fs::syscalls::flock(fd, operation)
275275
}

src/fs/getpath.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ use imp::fd::AsFd;
1111
#[inline]
1212
pub fn getpath<Fd: AsFd>(fd: &Fd) -> io::Result<ZString> {
1313
let fd = fd.as_fd();
14-
imp::syscalls::getpath(fd)
14+
imp::fs::syscalls::getpath(fd)
1515
}

0 commit comments

Comments
 (0)