@@ -9,14 +9,13 @@ use clap::{Arg, ArgAction, Command, builder::ValueParser};
99use std:: ffi:: OsString ;
1010use std:: io:: { self , Write } ;
1111use uucore:: error:: { UResult , USimpleError , strip_errno} ;
12- use uucore:: format_usage;
13- use uucore:: translate;
12+ #[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
13+ use uucore:: pipes:: MAX_ROOTLESS_PIPE_SIZE ;
14+ use uucore:: { format_usage, translate} ;
1415
1516#[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
1617const PAGE_SIZE : usize = 4096 ;
1718#[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
18- use uucore:: pipes:: MAX_ROOTLESS_PIPE_SIZE ;
19- #[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
2019const BUF_SIZE : usize = MAX_ROOTLESS_PIPE_SIZE ;
2120// it's possible that using a smaller or larger buffer might provide better performance
2221#[ cfg( not( any( target_os = "linux" , target_os = "android" ) ) ) ]
@@ -116,6 +115,7 @@ pub fn exec(mut bytes: Vec<u8>) -> io::Result<()> {
116115#[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
117116pub fn exec ( mut bytes : Vec < u8 > ) -> io:: Result < ( ) > {
118117 use uucore:: pipes:: { pipe, splice, tee} ;
118+
119119 let aligned = PAGE_SIZE . is_multiple_of ( bytes. len ( ) ) ;
120120 repeat_content_to_capacity ( & mut bytes) ;
121121 let bytes = bytes. as_slice ( ) ;
0 commit comments