File tree 1 file changed +6
-1
lines changed
crates/wasi-common/yanix/src/sys/linux
1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,11 @@ use crate::{cstr, from_success_code};
4
4
use std:: fs;
5
5
use std:: io:: Result ;
6
6
7
+ #[ cfg( not( any( target_os = "linux" , target_os = "emscripten" , target_os = "l4re" ) ) ) ]
8
+ use libc:: openat as libc_openat;
9
+ #[ cfg( any( target_os = "linux" , target_os = "emscripten" , target_os = "l4re" ) ) ]
10
+ use libc:: openat64 as libc_openat;
11
+
7
12
/// Combines `openat` with `utimes` to emulate `utimensat` on platforms where it is
8
13
/// not available. The logic for setting file times is based on [filetime::unix::set_file_handles_times].
9
14
///
@@ -23,7 +28,7 @@ pub fn utimesat(
23
28
if symlink_nofollow {
24
29
flags |= libc:: O_NOFOLLOW ;
25
30
}
26
- let fd = unsafe { libc :: openat64 ( dirfd. as_raw_fd ( ) , path. as_ptr ( ) , flags) } ;
31
+ let fd = unsafe { libc_openat ( dirfd. as_raw_fd ( ) , path. as_ptr ( ) , flags) } ;
27
32
let f = unsafe { fs:: File :: from_raw_fd ( fd) } ;
28
33
let ( atime, mtime) = get_times ( atime, mtime, || f. metadata ( ) . map_err ( Into :: into) ) ?;
29
34
let times = [ to_timeval ( atime) ?, to_timeval ( mtime) ?] ;
You can’t perform that action at this time.
0 commit comments