@@ -73,33 +73,35 @@ macro_rules! skip_if_not_root {
73
73
} ;
74
74
}
75
75
76
- #[ cfg( target_os = "linux" ) ]
77
- macro_rules! skip_if_seccomp {
78
- ( $name: expr) => {
79
- if let Ok ( s) = std:: fs:: read_to_string( "/proc/self/status" ) {
80
- for l in s. lines( ) {
81
- let mut fields = l. split_whitespace( ) ;
82
- if fields. next( ) == Some ( "Seccomp:" ) &&
83
- fields. next( ) != Some ( "0" )
84
- {
85
- use :: std:: io:: Write ;
86
- let stderr = :: std:: io:: stderr( ) ;
87
- let mut handle = stderr. lock( ) ;
88
- writeln!( handle,
89
- "{} cannot be run in Seccomp mode. Skipping test." ,
90
- stringify!( $name) ) . unwrap( ) ;
91
- return ;
76
+ cfg_if ! {
77
+ if #[ cfg( any( target_os = "android" , target_os = "linux" ) ) ] {
78
+ macro_rules! skip_if_seccomp {
79
+ ( $name: expr) => {
80
+ if let Ok ( s) = std:: fs:: read_to_string( "/proc/self/status" ) {
81
+ for l in s. lines( ) {
82
+ let mut fields = l. split_whitespace( ) ;
83
+ if fields. next( ) == Some ( "Seccomp:" ) &&
84
+ fields. next( ) != Some ( "0" )
85
+ {
86
+ use :: std:: io:: Write ;
87
+ let stderr = :: std:: io:: stderr( ) ;
88
+ let mut handle = stderr. lock( ) ;
89
+ writeln!( handle,
90
+ "{} cannot be run in Seccomp mode. Skipping test." ,
91
+ stringify!( $name) ) . unwrap( ) ;
92
+ return ;
93
+ }
94
+ }
92
95
}
93
96
}
94
97
}
98
+ } else {
99
+ macro_rules! skip_if_seccomp {
100
+ ( $name: expr) => { }
101
+ }
95
102
}
96
103
}
97
104
98
- #[ cfg( not( target_os = "linux" ) ) ]
99
- macro_rules! skip_if_seccomp {
100
- ( $name: expr) => { }
101
- }
102
-
103
105
mod sys;
104
106
mod test_dir;
105
107
mod test_fcntl;
0 commit comments