11#![ unstable( reason = "not public" , issue = "none" , feature = "fd" ) ]
2+ #![ allow( unsafe_op_in_unsafe_fn) ]
23
34#[ cfg( test) ]
45mod tests;
@@ -22,6 +23,10 @@ use crate::cmp;
2223use crate :: io:: { self , BorrowedCursor , IoSlice , IoSliceMut , Read } ;
2324use crate :: os:: unix:: io:: { AsFd , AsRawFd , BorrowedFd , FromRawFd , IntoRawFd , OwnedFd , RawFd } ;
2425use crate :: sys:: cvt;
26+ #[ cfg( all( target_os = "android" , target_pointer_width = "64" ) ) ]
27+ use crate :: sys:: pal:: weak:: syscall;
28+ #[ cfg( any( all( target_os = "android" , target_pointer_width = "32" ) , target_vendor = "apple" ) ) ]
29+ use crate :: sys:: pal:: weak:: weak;
2530use crate :: sys_common:: { AsInner , FromInner , IntoInner } ;
2631
2732#[ derive( Debug ) ]
@@ -232,7 +237,7 @@ impl FileDesc {
232237 // implementation if `preadv` is not available.
233238 #[ cfg( all( target_os = "android" , target_pointer_width = "64" ) ) ]
234239 pub fn read_vectored_at ( & self , bufs : & mut [ IoSliceMut < ' _ > ] , offset : u64 ) -> io:: Result < usize > {
235- super :: weak :: syscall!(
240+ syscall ! (
236241 fn preadv(
237242 fd: libc:: c_int,
238243 iovec: * const libc:: iovec,
@@ -257,7 +262,7 @@ impl FileDesc {
257262 // and its metadata from LLVM IR.
258263 #[ no_sanitize( cfi) ]
259264 pub fn read_vectored_at ( & self , bufs : & mut [ IoSliceMut < ' _ > ] , offset : u64 ) -> io:: Result < usize > {
260- super :: weak :: weak!(
265+ weak ! (
261266 fn preadv64(
262267 fd: libc:: c_int,
263268 iovec: * const libc:: iovec,
@@ -293,7 +298,7 @@ impl FileDesc {
293298 // use "weak" linking.
294299 #[ cfg( target_vendor = "apple" ) ]
295300 pub fn read_vectored_at ( & self , bufs : & mut [ IoSliceMut < ' _ > ] , offset : u64 ) -> io:: Result < usize > {
296- super :: weak :: weak!(
301+ weak ! (
297302 fn preadv(
298303 fd: libc:: c_int,
299304 iovec: * const libc:: iovec,
@@ -442,7 +447,7 @@ impl FileDesc {
442447 // implementation if `pwritev` is not available.
443448 #[ cfg( all( target_os = "android" , target_pointer_width = "64" ) ) ]
444449 pub fn write_vectored_at ( & self , bufs : & [ IoSlice < ' _ > ] , offset : u64 ) -> io:: Result < usize > {
445- super :: weak :: syscall!(
450+ syscall ! (
446451 fn pwritev(
447452 fd: libc:: c_int,
448453 iovec: * const libc:: iovec,
@@ -464,7 +469,7 @@ impl FileDesc {
464469
465470 #[ cfg( all( target_os = "android" , target_pointer_width = "32" ) ) ]
466471 pub fn write_vectored_at ( & self , bufs : & [ IoSlice < ' _ > ] , offset : u64 ) -> io:: Result < usize > {
467- super :: weak :: weak!(
472+ weak ! (
468473 fn pwritev64(
469474 fd: libc:: c_int,
470475 iovec: * const libc:: iovec,
@@ -500,7 +505,7 @@ impl FileDesc {
500505 // use "weak" linking.
501506 #[ cfg( target_vendor = "apple" ) ]
502507 pub fn write_vectored_at ( & self , bufs : & [ IoSlice < ' _ > ] , offset : u64 ) -> io:: Result < usize > {
503- super :: weak :: weak!(
508+ weak ! (
504509 fn pwritev(
505510 fd: libc:: c_int,
506511 iovec: * const libc:: iovec,
0 commit comments