/// Just a simple wrapper for posix `preadv`. Provide a slice of `IoVec` as input.
Just a simple wrapper for posix `preadv`. Provide a slice of `IoVec` as input.
Just a simple wrapper for posix ` preadv ` . Provide a slice of ` IoVec ` as input .
pub fn readv(fd: RawFd, iovec: &[IoVec<&mut [u8]>], offset: u64) -> Result<usize> {
    loop {
        match preadv(fd, iovec, offset as off64_t).map_err(|_| last_error!()) {
            Ok(ret) => return Ok(ret),
            // Retry if the IO is interrupted by signal.
            Err(err) if err.kind() != ErrorKind::Interrupted => return Err(err),
            _ => continue,
        }
    }
}
pub fn readv ( fd : RawFd , iovec : & [ IoVec < & mut [ u8 ] > ] , offset : u64 ) -> Result < usize > { loop { match preadv ( fd , iovec , offset as off64_t ) . map_err ( | _ | last_error ! ( ) ) { Ok ( ret ) => return Ok ( ret ) , // Retry if the IO is interrupted by signal. Err ( err ) if err . kind ( ) != ErrorKind :: Interrupted => return Err ( err ) , _ => continue , } } }
Just a simple wrapper for posix `preadv`.
Just a simple wrapper for posix ` preadv ` .
fd
RawFd
iovec
&[IoVec<&mut [u8]>]
offset
u64