1
- use std:: fs:: { self , File } ;
1
+ #[ cfg( not( target_os = "redox" ) ) ]
2
+ use std:: fs;
3
+ use std:: fs:: File ;
4
+ #[ cfg( not( target_os = "redox" ) ) ]
2
5
use std:: os:: unix:: fs:: { symlink, PermissionsExt } ;
3
6
use std:: os:: unix:: prelude:: AsRawFd ;
7
+ #[ cfg( not( target_os = "redox" ) ) ]
4
8
use std:: time:: { Duration , UNIX_EPOCH } ;
9
+ #[ cfg( not( target_os = "redox" ) ) ]
5
10
use std:: path:: Path ;
6
11
7
- #[ cfg( not( any( target_os = "netbsd" ) ) ) ]
12
+ #[ cfg( not( any( target_os = "netbsd" , target_os = "redox" ) ) ) ]
8
13
use libc:: { S_IFMT , S_IFLNK , mode_t} ;
9
14
15
+ #[ cfg( not( target_os = "redox" ) ) ]
10
16
use nix:: { fcntl, Error } ;
11
- use nix:: errno:: { Errno } ;
12
- use nix:: sys:: stat:: { self , fchmod, futimens, stat, utimes} ;
17
+ #[ cfg( not( target_os = "redox" ) ) ]
18
+ use nix:: errno:: Errno ;
19
+ #[ cfg( not( target_os = "redox" ) ) ]
20
+ use nix:: sys:: stat:: { self , futimens, utimes} ;
21
+ use nix:: sys:: stat:: { fchmod, stat} ;
13
22
#[ cfg( not( target_os = "redox" ) ) ]
14
23
use nix:: sys:: stat:: { fchmodat, utimensat, mkdirat} ;
15
24
#[ cfg( any( target_os = "linux" ,
@@ -19,30 +28,34 @@ use nix::sys::stat::{fchmodat, utimensat, mkdirat};
19
28
target_os = "freebsd" ,
20
29
target_os = "netbsd" ) ) ]
21
30
use nix:: sys:: stat:: lutimes;
22
- use nix:: sys:: stat:: { Mode , FchmodatFlags , UtimensatFlags } ;
31
+ #[ cfg( not( target_os = "redox" ) ) ]
32
+ use nix:: sys:: stat:: { FchmodatFlags , UtimensatFlags } ;
33
+ use nix:: sys:: stat:: Mode ;
23
34
24
- #[ cfg( not( any( target_os = "netbsd" ) ) ) ]
35
+ #[ cfg( not( any( target_os = "netbsd" , target_os = "redox" ) ) ) ]
25
36
use nix:: sys:: stat:: FileStat ;
26
37
38
+ #[ cfg( not( target_os = "redox" ) ) ]
27
39
use nix:: sys:: time:: { TimeSpec , TimeVal , TimeValLike } ;
40
+ #[ cfg( not( target_os = "redox" ) ) ]
28
41
use nix:: unistd:: chdir;
29
42
30
- #[ cfg( not( any( target_os = "netbsd" ) ) ) ]
43
+ #[ cfg( not( any( target_os = "netbsd" , target_os = "redox" ) ) ) ]
31
44
use nix:: Result ;
32
45
use tempfile;
33
46
34
47
#[ allow( unused_comparisons) ]
35
48
// uid and gid are signed on Windows, but not on other platforms. This function
36
49
// allows warning free compiles on all platforms, and can be removed when
37
50
// expression-level #[allow] is available.
38
- #[ cfg( not( any( target_os = "netbsd" ) ) ) ]
51
+ #[ cfg( not( any( target_os = "netbsd" , target_os = "redox" ) ) ) ]
39
52
fn valid_uid_gid ( stat : FileStat ) -> bool {
40
53
// uid could be 0 for the `root` user. This quite possible when
41
54
// the tests are being run on a rooted Android device.
42
55
stat. st_uid >= 0 && stat. st_gid >= 0
43
56
}
44
57
45
- #[ cfg( not( any( target_os = "netbsd" ) ) ) ]
58
+ #[ cfg( not( any( target_os = "netbsd" , target_os = "redox" ) ) ) ]
46
59
fn assert_stat_results ( stat_result : Result < FileStat > ) {
47
60
let stats = stat_result. expect ( "stat call failed" ) ;
48
61
assert ! ( stats. st_dev > 0 ) ; // must be positive integer, exact number machine dependent
@@ -55,7 +68,7 @@ fn assert_stat_results(stat_result: Result<FileStat>) {
55
68
assert ! ( stats. st_blocks <= 16 ) ; // Up to 16 blocks can be allocated for a blank file
56
69
}
57
70
58
- #[ cfg( not( any( target_os = "netbsd" ) ) ) ]
71
+ #[ cfg( not( any( target_os = "netbsd" , target_os = "redox" ) ) ) ]
59
72
fn assert_lstat_results ( stat_result : Result < FileStat > ) {
60
73
let stats = stat_result. expect ( "stat call failed" ) ;
61
74
assert ! ( stats. st_dev > 0 ) ; // must be positive integer, exact number machine dependent
@@ -189,6 +202,7 @@ fn test_fchmodat() {
189
202
///
190
203
/// The atime and mtime are expressed with a resolution of seconds because some file systems
191
204
/// (like macOS's HFS+) do not have higher granularity.
205
+ #[ cfg( not( target_os = "redox" ) ) ]
192
206
fn assert_times_eq ( exp_atime_sec : u64 , exp_mtime_sec : u64 , attr : & fs:: Metadata ) {
193
207
assert_eq ! (
194
208
Duration :: new( exp_atime_sec, 0 ) ,
0 commit comments