mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-30 13:53:41 +00:00
Modify the userspace read/write usage location
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
af908c29cf
commit
cd2b305fa8
@ -8,6 +8,6 @@ pub fn sys_getcwd(buf: Vaddr, len: usize) -> Result<SyscallReturn> {
|
||||
let fake_cwd = CString::new("/")?;
|
||||
let bytes = fake_cwd.as_bytes_with_nul();
|
||||
let write_len = len.min(bytes.len());
|
||||
write_bytes_to_user(buf, &bytes[..write_len])?;
|
||||
write_bytes_to_user(buf, &mut VmReader::from(&bytes[..write_len]))?;
|
||||
Ok(SyscallReturn::Return(write_len as _))
|
||||
}
|
||||
|
Reference in New Issue
Block a user