pub async fn sys_readv(
        &self,
        fd: FileDesc,
        iov_ptr: UserInPtr<IoVecOut>,
        iov_count: usize,
    ) -> SysResult {
        info!("readv: fd={:?}, iov={:?}, count={}", fd, iov_ptr, iov_count);
        let mut iovs = iov_ptr.read_iovecs(iov_count)?;
        let proc = self.linux_process();
        let file_like = proc.get_file_like(fd)?;
        let mut buf = vec![0u8; iovs.total_len()];
        let len = file_like.read(&mut buf).await?;
        iovs.write_from_buf(&buf)?;
        Ok(len)
    }
/// works just like read except that multiple buffers are filled.
/// reads iov_count buffers from the file
/// associated with the file descriptor fd into the buffers described by iov ("scatter input")
works just like read except that multiple buffers are filled.
reads iov_count buffers from the file
associated with the file descriptor fd into the buffers described by iov ("scatter input")
works just like read except that multiple buffers are filled . reads iov_count buffers from the file associated with the file descriptor fd into the buffers described by iov ( " scatter input " )
pub async fn sys_readv(
        &self,
        fd: FileDesc,
        iov_ptr: UserInPtr<IoVecOut>,
        iov_count: usize,
    ) -> SysResult {
        info!("readv: fd={:?}, iov={:?}, count={}", fd, iov_ptr, iov_count);
        let mut iovs = iov_ptr.read_iovecs(iov_count)?;
        let proc = self.linux_process();
        let file_like = proc.get_file_like(fd)?;
        let mut buf = vec![0u8; iovs.total_len()];
        let len = file_like.read(&mut buf).await?;
        iovs.write_from_buf(&buf)?;
        Ok(len)
    }
pub async fn sys_readv ( & self , fd : FileDesc , iov_ptr : UserInPtr < IoVecOut > , iov_count : usize , ) -> SysResult { info ! ( " " fd iov_ptr iov_count ) ; let mut iovs = iov_ptr . read_iovecs ( iov_count ) ? ; let proc = self . linux_process ( ) ; let file_like = proc . get_file_like ( fd ) ? ; let mut buf = vec ! [ 0u8 iovs total_len ( ) ] ; let len = file_like . read ( & mut buf ) . await ? ; iovs . write_from_buf ( & buf ) ? ; Ok ( len ) }
works just like read except that multiple buffers are filled.
works just like read except that multiple buffers are filled .
&self
fd
FileDesc
iov_ptr
UserInPtr<IoVecOut>
iov_count
usize
&self
fd
FileDesc
iov_ptr
UserInPtr<IoVecOut>
iov_count
usize