epoll_pwait, ppoll, pselect: add to process sigmask

Change-Id: I6aa1db3b4c6ad81a8b5926fa87fc645269b103b6
Refs: #1361
This commit is contained in:
Tomoki Shirasawa
2019-12-25 10:56:44 +09:00
committed by Masamichi Takagi
parent 911b07f507
commit f00d03445c
9 changed files with 362 additions and 6 deletions

View File

@ -3669,6 +3669,75 @@ SYSCALL_DECLARE(fcntl)
return rc;
}
SYSCALL_DECLARE(epoll_pwait)
{
long rc;
sigset_t *set = (sigset_t *)ihk_mc_syscall_arg4(ctx);
__sigset_t oldset;
__sigset_t wset;
struct thread *thread = cpu_local_var(current);
oldset = thread->sigmask.__val[0];
if (set) {
if (copy_from_user(&wset, set->__val, sizeof(wset))) {
return -EFAULT;
}
thread->sigmask.__val[0] = wset;
}
rc = syscall_generic_forwarding(__NR_epoll_pwait, ctx);
thread->sigmask.__val[0] = oldset;
return rc;
}
SYSCALL_DECLARE(ppoll)
{
long rc;
sigset_t *set = (sigset_t *)ihk_mc_syscall_arg3(ctx);
__sigset_t oldset;
__sigset_t wset;
struct thread *thread = cpu_local_var(current);
oldset = thread->sigmask.__val[0];
if (set) {
if (copy_from_user(&wset, set->__val, sizeof(wset))) {
return -EFAULT;
}
thread->sigmask.__val[0] = wset;
}
rc = syscall_generic_forwarding(__NR_ppoll, ctx);
thread->sigmask.__val[0] = oldset;
return rc;
}
SYSCALL_DECLARE(pselect6)
{
long rc;
sigset_t **_set = (sigset_t **)ihk_mc_syscall_arg5(ctx);
sigset_t *set = NULL;
__sigset_t oldset;
__sigset_t wset;
struct thread *thread = cpu_local_var(current);
if (_set) {
if (copy_from_user(&set, _set, sizeof(void *))) {
return -EFAULT;
}
}
oldset = thread->sigmask.__val[0];
if (set) {
if (copy_from_user(&wset, set->__val, sizeof(wset))) {
return -EFAULT;
}
thread->sigmask.__val[0] = wset;
}
rc = syscall_generic_forwarding(__NR_pselect6, ctx);
thread->sigmask.__val[0] = oldset;
return rc;
}
SYSCALL_DECLARE(rt_sigprocmask)
{
int how = ihk_mc_syscall_arg0(ctx);