@@ -20,10 +20,6 @@ use libc::{stat64, fstat64, lstat64, off64_t, ftruncate64, lseek64, dirent64, re
20
20
use libc:: fstatat64;
21
21
#[ cfg( any( target_os = "linux" , target_os = "emscripten" , target_os = "android" ) ) ]
22
22
use libc:: dirfd;
23
- // We only use struct `statx`, not the function `statx`.
24
- // Instead, use `syscall` to check if it is available at runtime.
25
- #[ cfg( target_os = "linux" ) ]
26
- use libc:: { statx, makedev} ;
27
23
#[ cfg( target_os = "android" ) ]
28
24
use libc:: { stat as stat64, fstat as fstat64, fstatat as fstatat64, lstat as lstat64, lseek64,
29
25
dirent as dirent64, open as open64} ;
@@ -79,15 +75,15 @@ unsafe fn try_statx(
79
75
pathname: * const libc:: c_char,
80
76
flags: c_int,
81
77
mask: libc:: c_uint,
82
- statxbuf: * mut statx
78
+ statxbuf: * mut libc :: statx
83
79
) -> c_int
84
80
}
85
81
86
82
if !HAS_STATX . load ( Ordering :: Relaxed ) {
87
83
return None ;
88
84
}
89
85
90
- let mut buf: statx = mem:: zeroed ( ) ;
86
+ let mut buf: libc :: statx = mem:: zeroed ( ) ;
91
87
let ret = cvt ( statx ( fd, path, flags, mask, & mut buf) ) ;
92
88
match ret {
93
89
Err ( err) => match err. raw_os_error ( ) {
@@ -100,13 +96,13 @@ unsafe fn try_statx(
100
96
Ok ( _) => {
101
97
// We cannot fill `stat64` exhaustively because of private padding fields.
102
98
let mut stat: stat64 = mem:: zeroed ( ) ;
103
- stat. st_dev = makedev ( buf. stx_dev_major , buf. stx_dev_minor ) ;
99
+ stat. st_dev = libc :: makedev ( buf. stx_dev_major , buf. stx_dev_minor ) ;
104
100
stat. st_ino = buf. stx_ino ;
105
101
stat. st_nlink = buf. stx_nlink as u64 ;
106
102
stat. st_mode = buf. stx_mode as u32 ;
107
103
stat. st_uid = buf. stx_uid ;
108
104
stat. st_gid = buf. stx_gid ;
109
- stat. st_rdev = makedev ( buf. stx_rdev_major , buf. stx_rdev_minor ) ;
105
+ stat. st_rdev = libc :: makedev ( buf. stx_rdev_major , buf. stx_rdev_minor ) ;
110
106
stat. st_size = buf. stx_size as i64 ;
111
107
stat. st_blksize = buf. stx_blksize as i64 ;
112
108
stat. st_blocks = buf. stx_blocks as i64 ;
@@ -264,7 +260,7 @@ impl FileAttr {
264
260
} else {
265
261
Err ( io:: Error :: new (
266
262
io:: ErrorKind :: Other ,
267
- "creation time is not available for the filesystam " ,
263
+ "creation time is not available for the filesystem " ,
268
264
) )
269
265
} ;
270
266
}
0 commit comments