summaryrefslogtreecommitdiffstats
path: root/sys/compat
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2003-03-31 22:49:17 +0000
committerjeff <jeff@FreeBSD.org>2003-03-31 22:49:17 +0000
commit46e6ba39f10b4874298cd617b4db656bb562eb37 (patch)
treeda7bdaf8a9eef1885d86203074ba0ad8ae222e7c /sys/compat
parent803202f956e45b36a05029bd98db32041fa3a23d (diff)
downloadFreeBSD-src-46e6ba39f10b4874298cd617b4db656bb562eb37.zip
FreeBSD-src-46e6ba39f10b4874298cd617b4db656bb562eb37.tar.gz
- Move p->p_sigmask to td->td_sigmask. Signal masks will be per thread with
a follow on commit to kern_sig.c - signotify() now operates on a thread since unmasked pending signals are stored in the thread. - PS_NEEDSIGCHK moves to TDF_NEEDSIGCHK.
Diffstat (limited to 'sys/compat')
-rw-r--r--sys/compat/linux/linux_signal.c29
-rw-r--r--sys/compat/svr4/svr4_filio.c4
-rw-r--r--sys/compat/svr4/svr4_signal.c25
3 files changed, 30 insertions, 28 deletions
diff --git a/sys/compat/linux/linux_signal.c b/sys/compat/linux/linux_signal.c
index 5ed0bdf..15a818f 100644
--- a/sys/compat/linux/linux_signal.c
+++ b/sys/compat/linux/linux_signal.c
@@ -236,24 +236,24 @@ linux_do_sigprocmask(struct thread *td, int how, l_sigset_t *new,
PROC_LOCK(p);
if (old != NULL)
- bsd_to_linux_sigset(&p->p_sigmask, old);
+ bsd_to_linux_sigset(&td->td_sigmask, old);
if (new != NULL) {
linux_to_bsd_sigset(new, &mask);
switch (how) {
case LINUX_SIG_BLOCK:
- SIGSETOR(p->p_sigmask, mask);
- SIG_CANTMASK(p->p_sigmask);
+ SIGSETOR(td->td_sigmask, mask);
+ SIG_CANTMASK(td->td_sigmask);
break;
case LINUX_SIG_UNBLOCK:
- SIGSETNAND(p->p_sigmask, mask);
- signotify(p);
+ SIGSETNAND(td->td_sigmask, mask);
+ signotify(td);
break;
case LINUX_SIG_SETMASK:
- p->p_sigmask = mask;
- SIG_CANTMASK(p->p_sigmask);
- signotify(p);
+ td->td_sigmask = mask;
+ SIG_CANTMASK(td->td_sigmask);
+ signotify(td);
break;
default:
error = EINVAL;
@@ -345,7 +345,7 @@ linux_sgetmask(struct thread *td, struct linux_sgetmask_args *args)
#endif
PROC_LOCK(p);
- bsd_to_linux_sigset(&p->p_sigmask, &mask);
+ bsd_to_linux_sigset(&td->td_sigmask, &mask);
PROC_UNLOCK(p);
td->td_retval[0] = mask.__bits[0];
return (0);
@@ -364,14 +364,14 @@ linux_ssetmask(struct thread *td, struct linux_ssetmask_args *args)
#endif
PROC_LOCK(p);
- bsd_to_linux_sigset(&p->p_sigmask, &lset);
+ bsd_to_linux_sigset(&td->td_sigmask, &lset);
td->td_retval[0] = lset.__bits[0];
LINUX_SIGEMPTYSET(lset);
lset.__bits[0] = args->mask;
linux_to_bsd_sigset(&lset, &bset);
- p->p_sigmask = bset;
- SIG_CANTMASK(p->p_sigmask);
- signotify(p);
+ td->td_sigmask = bset;
+ SIG_CANTMASK(td->td_sigmask);
+ signotify(td);
PROC_UNLOCK(p);
return (0);
}
@@ -394,7 +394,8 @@ linux_sigpending(struct thread *td, struct linux_sigpending_args *args)
PROC_LOCK(p);
bset = p->p_siglist;
- SIGSETAND(bset, p->p_sigmask);
+ SIGSETOR(bset, td->td_siglist);
+ SIGSETAND(bset, td->td_sigmask);
bsd_to_linux_sigset(&bset, &lset);
PROC_UNLOCK(p);
mask = lset.__bits[0];
diff --git a/sys/compat/svr4/svr4_filio.c b/sys/compat/svr4/svr4_filio.c
index ca1b8db..870da5d 100644
--- a/sys/compat/svr4/svr4_filio.c
+++ b/sys/compat/svr4/svr4_filio.c
@@ -132,10 +132,10 @@ svr4_sys_read(td, uap)
DPRINTF(("svr4_read(%d, 0x%0x, %d) = %d\n",
uap->fd, uap->buf, uap->nbyte, rv));
if (rv == EAGAIN) {
- DPRINTF(("sigmask = 0x%x\n", td->td_proc->p_sigmask));
+ DPRINTF(("sigmask = 0x%x\n", td->td_sigmask));
DPRINTF(("sigignore = 0x%x\n", td->td_proc->p_sigignore));
DPRINTF(("sigcaught = 0x%x\n", td->td_proc->p_sigcatch));
- DPRINTF(("siglist = 0x%x\n", td->td_proc->p_siglist));
+ DPRINTF(("siglist = 0x%x\n", td->td_siglist));
}
#if defined(GROTTY_READ_HACK)
diff --git a/sys/compat/svr4/svr4_signal.c b/sys/compat/svr4/svr4_signal.c
index 3e688e6..c45b7cb 100644
--- a/sys/compat/svr4/svr4_signal.c
+++ b/sys/compat/svr4/svr4_signal.c
@@ -481,7 +481,7 @@ sighold:
set = stackgap_alloc(&sg, sizeof(sigset_t));
PROC_LOCK(td->td_proc);
- *set = td->td_proc->p_sigmask;
+ *set = td->td_sigmask;
PROC_UNLOCK(td->td_proc);
SIGDELSET(*set, signum);
sa.sigmask = set;
@@ -507,7 +507,7 @@ svr4_sys_sigprocmask(td, uap)
if (uap->oset != NULL) {
/* Fix the return value first if needed */
PROC_LOCK(td->td_proc);
- bsd_to_svr4_sigset(&td->td_proc->p_sigmask, &sss);
+ bsd_to_svr4_sigset(&td->td_sigmask, &sss);
PROC_UNLOCK(td->td_proc);
if ((error = copyout(&sss, uap->oset, sizeof(sss))) != 0)
return error;
@@ -525,19 +525,19 @@ svr4_sys_sigprocmask(td, uap)
PROC_LOCK(td->td_proc);
switch (uap->how) {
case SVR4_SIG_BLOCK:
- SIGSETOR(td->td_proc->p_sigmask, bss);
- SIG_CANTMASK(td->td_proc->p_sigmask);
+ SIGSETOR(td->td_sigmask, bss);
+ SIG_CANTMASK(td->td_sigmask);
break;
case SVR4_SIG_UNBLOCK:
- SIGSETNAND(td->td_proc->p_sigmask, bss);
- signotify(td->td_proc);
+ SIGSETNAND(td->td_sigmask, bss);
+ signotify(td);
break;
case SVR4_SIG_SETMASK:
- td->td_proc->p_sigmask = bss;
- SIG_CANTMASK(td->td_proc->p_sigmask);
- signotify(td->td_proc);
+ td->td_sigmask = bss;
+ SIG_CANTMASK(td->td_sigmask);
+ signotify(td);
break;
default:
@@ -566,7 +566,8 @@ svr4_sys_sigpending(td, uap)
return 0;
PROC_LOCK(td->td_proc);
bss = td->td_proc->p_siglist;
- SIGSETAND(bss, td->td_proc->p_sigmask);
+ SIGSETOR(bss, td->td_siglist);
+ SIGSETAND(bss, td->td_sigmask);
PROC_UNLOCK(td->td_proc);
bsd_to_svr4_sigset(&bss, &sss);
break;
@@ -636,7 +637,7 @@ svr4_sys_context(td, uap)
case 0:
PROC_LOCK(td->td_proc);
DPRINTF(("getcontext(%p)\n", uap->uc));
- svr4_getcontext(td, &uc, &td->td_proc->p_sigmask,
+ svr4_getcontext(td, &uc, &td->td_sigmask,
sigonstack(cpu_getstack(td)));
PROC_UNLOCK(td->td_proc);
return copyout(&uc, uap->uc, sizeof(uc));
@@ -671,6 +672,6 @@ svr4_sys_pause(td, uap)
{
struct sigsuspend_args bsa;
- bsa.sigmask = &td->td_proc->p_sigmask;
+ bsa.sigmask = &td->td_sigmask;
return sigsuspend(td, &bsa);
}
OpenPOWER on IntegriCloud