File tree Expand file tree Collapse file tree 2 files changed +5
-11
lines changed
cap-primitives/src/rustix/fs Expand file tree Collapse file tree 2 files changed +5
-11
lines changed Original file line number Diff line number Diff line change 2
2
3
3
use crate :: fs:: { FileTypeExt , Metadata , PermissionsExt } ;
4
4
use crate :: time:: { Duration , SystemClock , SystemTime } ;
5
- // TODO: update all these to
6
- // #[cfg(any(target_os = "android", target_os = "linux"))]
7
- // once we're on restix >= v0.34.3.
8
- #[ cfg( all( target_os = "linux" , target_env = "gnu" ) ) ]
5
+ #[ cfg( any( target_os = "android" , target_os = "linux" ) ) ]
9
6
use rustix:: fs:: { makedev, Statx } ;
10
7
use rustix:: fs:: { RawMode , Stat } ;
11
8
use std:: convert:: { TryFrom , TryInto } ;
@@ -222,7 +219,7 @@ impl MetadataExt {
222
219
}
223
220
224
221
/// Constructs a new instance of `Metadata` from the given `Statx`.
225
- #[ cfg( all ( target_os = "linux " , target_env = "gnu " ) ) ]
222
+ #[ cfg( any ( target_os = "android " , target_os = "linux " ) ) ]
226
223
#[ inline]
227
224
pub ( crate ) fn from_rustix_statx ( statx : Statx ) -> Metadata {
228
225
Metadata {
Original file line number Diff line number Diff line change @@ -3,12 +3,9 @@ use rustix::fs::{statat, AtFlags};
3
3
use std:: path:: Path ;
4
4
use std:: { fs, io} ;
5
5
6
- // TODO: update all these to
7
- // #[cfg(any(target_os = "android", target_os = "linux"))]
8
- // once we're on restix >= v0.34.3.
9
- #[ cfg( all( target_os = "linux" , target_env = "gnu" ) ) ]
6
+ #[ cfg( any( target_os = "android" , target_os = "linux" ) ) ]
10
7
use rustix:: fs:: { statx, StatxFlags } ;
11
- #[ cfg( all ( target_os = "linux " , target_env = "gnu " ) ) ]
8
+ #[ cfg( any ( target_os = "android " , target_os = "linux " ) ) ]
12
9
use std:: sync:: atomic:: { AtomicU8 , Ordering } ;
13
10
14
11
/// *Unsandboxed* function similar to `stat`, but which does not perform
@@ -28,7 +25,7 @@ pub(crate) fn stat_unchecked(
28
25
// Older versions of Docker/seccomp would return `EPERM` for `statx`; see
29
26
// <https://github.com/rust-lang/rust/pull/65685/>. We store the
30
27
// availability in a global to avoid unnecessary syscalls.
31
- #[ cfg( all ( target_os = "linux " , target_env = "gnu " ) ) ]
28
+ #[ cfg( any ( target_os = "android " , target_os = "linux " ) ) ]
32
29
{
33
30
// 0: Unknown
34
31
// 1: Not available
You can’t perform that action at this time.
0 commit comments