mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-28 03:43:23 +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
@ -8,7 +8,6 @@ use crate::{
|
||||
},
|
||||
prelude::*,
|
||||
syscall::constants::MAX_FILENAME_LEN,
|
||||
util::read_cstring_from_user,
|
||||
};
|
||||
|
||||
pub fn sys_linkat(
|
||||
@ -18,8 +17,10 @@ pub fn sys_linkat(
|
||||
new_path_addr: Vaddr,
|
||||
flags: u32,
|
||||
) -> Result<SyscallReturn> {
|
||||
let old_path = read_cstring_from_user(old_path_addr, MAX_FILENAME_LEN)?;
|
||||
let new_path = read_cstring_from_user(new_path_addr, MAX_FILENAME_LEN)?;
|
||||
let user_space = CurrentUserSpace::get();
|
||||
|
||||
let old_path = user_space.read_cstring(old_path_addr, MAX_FILENAME_LEN)?;
|
||||
let new_path = user_space.read_cstring(new_path_addr, MAX_FILENAME_LEN)?;
|
||||
let flags =
|
||||
LinkFlags::from_bits(flags).ok_or(Error::with_message(Errno::EINVAL, "invalid flags"))?;
|
||||
debug!(
|
||||
|
Reference in New Issue
Block a user