1
1
#![ unstable( reason = "not public" , issue = "none" , feature = "fd" ) ]
2
+ #![ allow( unsafe_op_in_unsafe_fn) ]
2
3
3
4
#[ cfg( test) ]
4
5
mod tests;
@@ -22,6 +23,10 @@ use crate::cmp;
22
23
use crate :: io:: { self , BorrowedCursor , IoSlice , IoSliceMut , Read } ;
23
24
use crate :: os:: unix:: io:: { AsFd , AsRawFd , BorrowedFd , FromRawFd , IntoRawFd , OwnedFd , RawFd } ;
24
25
use 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;
25
30
use crate :: sys_common:: { AsInner , FromInner , IntoInner } ;
26
31
27
32
#[ derive( Debug ) ]
@@ -232,7 +237,7 @@ impl FileDesc {
232
237
// implementation if `preadv` is not available.
233
238
#[ cfg( all( target_os = "android" , target_pointer_width = "64" ) ) ]
234
239
pub fn read_vectored_at ( & self , bufs : & mut [ IoSliceMut < ' _ > ] , offset : u64 ) -> io:: Result < usize > {
235
- super :: weak :: syscall!(
240
+ syscall ! (
236
241
fn preadv(
237
242
fd: libc:: c_int,
238
243
iovec: * const libc:: iovec,
@@ -257,7 +262,7 @@ impl FileDesc {
257
262
// and its metadata from LLVM IR.
258
263
#[ no_sanitize( cfi) ]
259
264
pub fn read_vectored_at ( & self , bufs : & mut [ IoSliceMut < ' _ > ] , offset : u64 ) -> io:: Result < usize > {
260
- super :: weak :: weak!(
265
+ weak ! (
261
266
fn preadv64(
262
267
fd: libc:: c_int,
263
268
iovec: * const libc:: iovec,
@@ -293,7 +298,7 @@ impl FileDesc {
293
298
// use "weak" linking.
294
299
#[ cfg( target_vendor = "apple" ) ]
295
300
pub fn read_vectored_at ( & self , bufs : & mut [ IoSliceMut < ' _ > ] , offset : u64 ) -> io:: Result < usize > {
296
- super :: weak :: weak!(
301
+ weak ! (
297
302
fn preadv(
298
303
fd: libc:: c_int,
299
304
iovec: * const libc:: iovec,
@@ -442,7 +447,7 @@ impl FileDesc {
442
447
// implementation if `pwritev` is not available.
443
448
#[ cfg( all( target_os = "android" , target_pointer_width = "64" ) ) ]
444
449
pub fn write_vectored_at ( & self , bufs : & [ IoSlice < ' _ > ] , offset : u64 ) -> io:: Result < usize > {
445
- super :: weak :: syscall!(
450
+ syscall ! (
446
451
fn pwritev(
447
452
fd: libc:: c_int,
448
453
iovec: * const libc:: iovec,
@@ -464,7 +469,7 @@ impl FileDesc {
464
469
465
470
#[ cfg( all( target_os = "android" , target_pointer_width = "32" ) ) ]
466
471
pub fn write_vectored_at ( & self , bufs : & [ IoSlice < ' _ > ] , offset : u64 ) -> io:: Result < usize > {
467
- super :: weak :: weak!(
472
+ weak ! (
468
473
fn pwritev64(
469
474
fd: libc:: c_int,
470
475
iovec: * const libc:: iovec,
@@ -500,7 +505,7 @@ impl FileDesc {
500
505
// use "weak" linking.
501
506
#[ cfg( target_vendor = "apple" ) ]
502
507
pub fn write_vectored_at ( & self , bufs : & [ IoSlice < ' _ > ] , offset : u64 ) -> io:: Result < usize > {
503
- super :: weak :: weak!(
508
+ weak ! (
504
509
fn pwritev(
505
510
fd: libc:: c_int,
506
511
iovec: * const libc:: iovec,
0 commit comments