mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-23 17:33:23 +00:00
Modify the userspace read/write usage location
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
af908c29cf
commit
cd2b305fa8
@ -17,6 +17,6 @@ pub fn sys_read(fd: FileDesc, user_buf_addr: Vaddr, buf_len: usize) -> Result<Sy
|
||||
|
||||
let mut read_buf = vec![0u8; buf_len];
|
||||
let read_len = file.read(&mut read_buf)?;
|
||||
write_bytes_to_user(user_buf_addr, &read_buf)?;
|
||||
write_bytes_to_user(user_buf_addr, &mut VmReader::from(read_buf.as_slice()))?;
|
||||
Ok(SyscallReturn::Return(read_len as _))
|
||||
}
|
||||
|
Reference in New Issue
Block a user