mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-29 04:13:24 +00:00
Replace old user space read/write with new APIs
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
7ade2fcb57
commit
75da7fd30e
@ -1,7 +1,7 @@
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
use super::SyscallReturn;
|
||||
use crate::{prelude::*, time::SystemTime, util::write_val_to_user};
|
||||
use crate::{prelude::*, time::SystemTime};
|
||||
|
||||
pub fn sys_time(tloc: Vaddr) -> Result<SyscallReturn> {
|
||||
debug!("tloc = 0x{tloc:x}");
|
||||
@ -12,7 +12,7 @@ pub fn sys_time(tloc: Vaddr) -> Result<SyscallReturn> {
|
||||
};
|
||||
|
||||
if tloc != 0 {
|
||||
write_val_to_user(tloc, &now_as_secs)?;
|
||||
CurrentUserSpace::get().write_val(tloc, &now_as_secs)?;
|
||||
}
|
||||
|
||||
Ok(SyscallReturn::Return(now_as_secs as _))
|
||||
|
Reference in New Issue
Block a user