@@ -396,7 +396,7 @@ impl Client {
396
396
mod linux {
397
397
use super :: * ;
398
398
399
- use libc:: { iovec, off_t , ssize_t, syscall, SYS_preadv2 } ;
399
+ use libc:: { iovec, ssize_t, syscall, SYS_preadv2 } ;
400
400
401
401
const RWF_NOWAIT : c_int = 0x00000008 ;
402
402
@@ -408,27 +408,21 @@ mod linux {
408
408
}
409
409
}
410
410
411
- unsafe fn preadv2 (
412
- fd : c_int ,
413
- iov : * const iovec ,
414
- iovcnt : c_int ,
415
- offset : off_t ,
416
- flags : c_int ,
417
- ) -> ssize_t {
411
+ unsafe fn preadv2 ( fd : c_int , iov : * const iovec , iovcnt : c_int , flags : c_int ) -> ssize_t {
418
412
#[ cfg( all( target_arch = "x86_64" , target_pointer_width = "64" ) ) ]
419
- let res = syscall ( SYS_preadv2 , fd, iov, iovcnt, offset , 0 , flags) ;
413
+ let res = syscall ( SYS_preadv2 , fd, iov, iovcnt, - 1 , 0 , flags) ;
420
414
421
415
#[ cfg( all( target_arch = "x86_64" , target_pointer_width = "32" ) ) ]
422
- let res = syscall ( SYS_preadv2 , fd, iov, iovcnt, offset , flags) ;
416
+ let res = syscall ( SYS_preadv2 , fd, iov, iovcnt, - 1 , flags) ;
423
417
424
418
#[ cfg( not( target_arch = "x86_64" ) ) ]
425
419
let res = syscall (
426
420
SYS_preadv2 ,
427
421
fd,
428
422
iov,
429
423
iovcnt,
430
- offset as libc:: c_long ,
431
- ( ( offset as u64 ) >> 32 ) as libc:: c_long ,
424
+ - 1 as libc:: c_long ,
425
+ ( ( - 1 as u64 ) >> 32 ) as libc:: c_long ,
432
426
flags,
433
427
) ;
434
428
@@ -450,7 +444,6 @@ mod linux {
450
444
iov_len : buf. len ( ) ,
451
445
} ,
452
446
1 ,
453
- -1 ,
454
447
RWF_NOWAIT ,
455
448
)
456
449
} ) {
0 commit comments