66#[ cfg( test) ]
77mod tests;
88
9- #[ cfg( all( target_os = "linux" , target_env = "gnu" ) ) ]
9+ #[ cfg( all( target_os = "linux" ) ) ]
1010use libc:: c_char;
1111#[ cfg( any(
1212 all( target_os = "linux" , not( target_env = "musl" ) ) ,
@@ -93,7 +93,7 @@ use crate::sys::fd::FileDesc;
9393pub use crate :: sys:: fs:: common:: exists;
9494use crate :: sys:: helpers:: run_path_with_cstr;
9595use crate :: sys:: time:: SystemTime ;
96- #[ cfg( all( target_os = "linux" , target_env = "gnu" ) ) ]
96+ #[ cfg( all( target_os = "linux" ) ) ]
9797use crate :: sys:: weak:: syscall;
9898#[ cfg( target_os = "android" ) ]
9999use crate :: sys:: weak:: weak;
@@ -102,14 +102,14 @@ use crate::{mem, ptr};
102102
103103pub struct File ( FileDesc ) ;
104104
105- // FIXME: This should be available on Linux with all `target_env`.
106- // But currently only glibc exposes `statx` fn and structs.
107- // We don't want to import unverified raw C structs here directly.
105+ // statx is available on Linux when:
106+ // - target_env = "gnu": added in glibc >= 2.28
107+ // - target_env = "musl": added in musl >= 1.2.5
108108// https://github.com/rust-lang/rust/pull/67774
109109macro_rules! cfg_has_statx {
110110 ( { $( $then_tt: tt) * } else { $( $else_tt: tt) * } ) => {
111111 cfg_select! {
112- all( target_os = "linux" , target_env = "gnu" ) => {
112+ all( target_os = "linux" ) => {
113113 $( $then_tt) *
114114 }
115115 _ => {
@@ -118,7 +118,7 @@ macro_rules! cfg_has_statx {
118118 }
119119 } ;
120120 ( $( $block_inner: tt) * ) => {
121- #[ cfg( all( target_os = "linux" , target_env = "gnu" ) ) ]
121+ #[ cfg( all( target_os = "linux" ) ) ]
122122 {
123123 $( $block_inner) *
124124 }
0 commit comments