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

@ -39,7 +39,10 @@ pub fn sys_prctl(option: i32, arg2: u64, arg3: u64, arg4: u64, arg5: u64) -> Res
let thread_name = posix_thread.thread_name().lock();
if let Some(thread_name) = &*thread_name {
if let Some(thread_name) = thread_name.name()? {
write_bytes_to_user(write_to_addr, thread_name.to_bytes_with_nul())?;
write_bytes_to_user(
write_to_addr,
&mut VmReader::from(thread_name.to_bytes_with_nul()),
)?;
}
}
}