Return when sigset size error for rt_sigsuspend, rt_sigprocmask and rt_sigaction

This commit is contained in:
Marsman1996
2024-09-30 17:12:52 +08:00
committed by Tate, Hongliang Tian
parent ab8b6afee5
commit 44760eb5fa
3 changed files with 5 additions and 2 deletions

View File

@ -22,6 +22,10 @@ pub fn sys_rt_sigaction(
sigset_size
);
if sigset_size != 8 {
return_errno_with_message!(Errno::EINVAL, "sigset size is not equal to 8");
}
let mut sig_dispositions = ctx.process.sig_dispositions().lock();
let old_action = if sig_action_addr != 0 {

View File

@ -24,7 +24,7 @@ pub fn sys_rt_sigprocmask(
mask_op, set_ptr, oldset_ptr, sigset_size
);
if sigset_size != 8 {
error!("sigset size is not equal to 8");
return_errno_with_message!(Errno::EINVAL, "sigset size is not equal to 8");
}
do_rt_sigprocmask(mask_op, set_ptr, oldset_ptr, ctx)?;
Ok(SyscallReturn::Return(0))

View File

@ -22,7 +22,6 @@ pub fn sys_rt_sigsuspend(
sigmask_addr, sigmask_size
);
debug_assert!(sigmask_size == core::mem::size_of::<SigMask>());
if sigmask_size != core::mem::size_of::<SigMask>() {
return_errno_with_message!(Errno::EINVAL, "invalid sigmask size");
}