@@ -244,16 +244,16 @@ pub trait CapStdExtDirExt {
244244 /// to determine, and `None` will be returned in those cases.
245245 fn is_mountpoint ( & self , path : impl AsRef < Path > ) -> Result < Option < bool > > ;
246246
247- #[ cfg( not ( windows ) ) ]
247+ #[ cfg( any ( target_os = "android" , target_os = "linux" ) ) ]
248248 /// Get the value of an extended attribute. If the attribute is not present,
249249 /// this function will return `Ok(None)`.
250250 fn getxattr ( & self , path : impl AsRef < Path > , key : impl AsRef < OsStr > ) -> Result < Option < Vec < u8 > > > ;
251251
252- #[ cfg( not ( windows ) ) ]
252+ #[ cfg( any ( target_os = "android" , target_os = "linux" ) ) ]
253253 /// List all extended attribute keys for this path.
254254 fn listxattrs ( & self , path : impl AsRef < Path > ) -> Result < crate :: XattrList > ;
255255
256- #[ cfg( not ( windows ) ) ]
256+ #[ cfg( any ( target_os = "android" , target_os = "linux" ) ) ]
257257 /// Set the value of an extended attribute.
258258 fn setxattr (
259259 & self ,
@@ -614,6 +614,10 @@ where
614614
615615// Ensure that the target path isn't absolute, and doesn't
616616// have any parent references.
617+ #[ cfg_attr(
618+ not( any( target_os = "android" , target_os = "linux" , test) ) ,
619+ allow( dead_code)
620+ ) ]
617621pub ( crate ) fn validate_relpath_no_uplinks ( path : & Path ) -> Result < & Path > {
618622 let is_absolute = path. is_absolute ( ) ;
619623 let contains_uplinks = path
@@ -828,17 +832,17 @@ impl CapStdExtDirExt for Dir {
828832 is_mountpoint_impl_statx ( self , path. as_ref ( ) ) . map_err ( Into :: into)
829833 }
830834
831- #[ cfg( not ( windows ) ) ]
835+ #[ cfg( any ( target_os = "android" , target_os = "linux" ) ) ]
832836 fn getxattr ( & self , path : impl AsRef < Path > , key : impl AsRef < OsStr > ) -> Result < Option < Vec < u8 > > > {
833837 crate :: xattrs:: impl_getxattr ( self , path. as_ref ( ) , key. as_ref ( ) )
834838 }
835839
836- #[ cfg( not ( windows ) ) ]
840+ #[ cfg( any ( target_os = "android" , target_os = "linux" ) ) ]
837841 fn listxattrs ( & self , path : impl AsRef < Path > ) -> Result < crate :: XattrList > {
838842 crate :: xattrs:: impl_listxattrs ( self , path. as_ref ( ) )
839843 }
840844
841- #[ cfg( not ( windows ) ) ]
845+ #[ cfg( any ( target_os = "android" , target_os = "linux" ) ) ]
842846 fn setxattr (
843847 & self ,
844848 path : impl AsRef < Path > ,
0 commit comments