pub async fn sys_pread(
        &self,
        fd: FileDesc,
        mut base: UserOutPtr<u8>,
        len: usize,
        offset: u64,
    ) -> SysResult {
        info!(
            "pread: fd={:?}, base={:?}, len={}, offset={}",
            fd, base, len, offset
        );
        let proc = self.linux_process();
        let file_like = proc.get_file_like(fd)?;
        let mut buf = vec![0u8; len];
        let len = file_like.read_at(offset, &mut buf).await?;
        base.write_array(&buf[..len])?;
        Ok(len)
    }
/// read from or write to a file descriptor at a given offset
/// reads up to count bytes from file descriptor fd at offset offset
/// (from the start of the file) into the buffer starting at buf. The file offset is not changed.
read from or write to a file descriptor at a given offset
reads up to count bytes from file descriptor fd at offset offset
(from the start of the file) into the buffer starting at buf. The file offset is not changed.
read from or write to a file descriptor at a given offset reads up to count bytes from file descriptor fd at offset offset ( from the start of the file ) into the buffer starting at buf . The file offset is not changed .
pub async fn sys_pread(
        &self,
        fd: FileDesc,
        mut base: UserOutPtr<u8>,
        len: usize,
        offset: u64,
    ) -> SysResult {
        info!(
            "pread: fd={:?}, base={:?}, len={}, offset={}",
            fd, base, len, offset
        );
        let proc = self.linux_process();
        let file_like = proc.get_file_like(fd)?;
        let mut buf = vec![0u8; len];
        let len = file_like.read_at(offset, &mut buf).await?;
        base.write_array(&buf[..len])?;
        Ok(len)
    }
pub async fn sys_pread ( & self , fd : FileDesc , mut base : UserOutPtr < u8 > , len : usize , offset : u64 , ) -> SysResult { info ! ( " " fd base len offset ) ; let proc = self . linux_process ( ) ; let file_like = proc . get_file_like ( fd ) ? ; let mut buf = vec ! [ 0u8 len ] ; let len = file_like . read_at ( offset , & mut buf ) . await ? ; base . write_array ( & buf [ .. len ] ) ? ; Ok ( len ) }
read from or write to a file descriptor at a given offset
reads up to count bytes from file descriptor fd at offset offset
(from the start of the file) into the buffer starting at buf.
read from or write to a file descriptor at a given offset reads up to count bytes from file descriptor fd at offset offset ( from the start of the file ) into the buffer starting at buf .
&self
fd
FileDesc
base
UserOutPtr<u8>
len
usize
offset
u64
&self
fd
FileDesc
base
UserOutPtr<u8>
len
usize
offset
u64