mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-22 17:03:23 +00:00
Remove the shim kernel crate
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
d76c7a5b1e
commit
dafd16075f
26
kernel/src/syscall/set_robust_list.rs
Normal file
26
kernel/src/syscall/set_robust_list.rs
Normal file
@ -0,0 +1,26 @@
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
use super::SyscallReturn;
|
||||
use crate::{prelude::*, process::posix_thread::RobustListHead};
|
||||
|
||||
pub fn sys_set_robust_list(
|
||||
robust_list_head_ptr: Vaddr,
|
||||
len: usize,
|
||||
ctx: &Context,
|
||||
) -> Result<SyscallReturn> {
|
||||
debug!(
|
||||
"robust list head ptr: 0x{:x}, len = {}",
|
||||
robust_list_head_ptr, len
|
||||
);
|
||||
if len != core::mem::size_of::<RobustListHead>() {
|
||||
return_errno_with_message!(
|
||||
Errno::EINVAL,
|
||||
"The len is not equal to the size of robust list head"
|
||||
);
|
||||
}
|
||||
let robust_list_head: RobustListHead = ctx.get_user_space().read_val(robust_list_head_ptr)?;
|
||||
debug!("{:x?}", robust_list_head);
|
||||
let mut robust_list = ctx.posix_thread.robust_list().lock();
|
||||
*robust_list = Some(robust_list_head);
|
||||
Ok(SyscallReturn::Return(0))
|
||||
}
|
Reference in New Issue
Block a user