Modify the userspace read/write usage location

This commit is contained in:
Chen Chengjun
2024-06-28 09:36:43 +08:00
committed by Tate, Hongliang Tian
parent af908c29cf
commit cd2b305fa8
14 changed files with 25 additions and 19 deletions

View File

@ -33,7 +33,7 @@ pub fn sys_pread64(
let read_len = {
let mut buffer = vec![0u8; user_buf_len];
let read_len = file.read_at(offset as usize, &mut buffer)?;
write_bytes_to_user(user_buf_ptr, &buffer)?;
write_bytes_to_user(user_buf_ptr, &mut VmReader::from(buffer.as_slice()))?;
read_len
};