diff options
Diffstat (limited to 'sys/kern/kern_sig.c')
-rw-r--r-- | sys/kern/kern_sig.c | 77 |
1 files changed, 1 insertions, 76 deletions
diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index bf89d8a..5da4725 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)kern_sig.c 8.7 (Berkeley) 4/18/94 - * $Id: kern_sig.c,v 1.52 1999/01/08 17:31:10 eivind Exp $ + * $Id: kern_sig.c,v 1.53 1999/01/10 01:58:24 eivind Exp $ */ #include "opt_compat.h" @@ -135,17 +135,9 @@ sigaction(p, uap) sa->sa_flags |= SA_RESETHAND; if ((ps->ps_signodefer & bit) != 0) sa->sa_flags |= SA_NODEFER; -#ifndef COMPAT_LINUX_THREADS - if (signum == SIGCHLD && p->p_flag & P_NOCLDSTOP) -#else if (signum == SIGCHLD && p->p_procsig->ps_flag & P_NOCLDSTOP) -#endif /* COMPAT_LINUX_THREADS */ sa->sa_flags |= SA_NOCLDSTOP; -#ifndef COMPAT_LINUX_THREADS - if (signum == SIGCHLD && p->p_flag & P_NOCLDWAIT) -#else if (signum == SIGCHLD && p->p_procsig->ps_flag & P_NOCLDWAIT) -#endif /* COMPAT_LINUX_THREADS */ sa->sa_flags |= SA_NOCLDWAIT; if ((error = copyout((caddr_t)sa, (caddr_t)uap->osa, sizeof (vec)))) @@ -203,15 +195,9 @@ setsigvec(p, signum, sa) #endif if (signum == SIGCHLD) { if (sa->sa_flags & SA_NOCLDSTOP) -#ifndef COMPAT_LINUX_THREADS - p->p_flag |= P_NOCLDSTOP; - else - p->p_flag &= ~P_NOCLDSTOP; -#else p->p_procsig->ps_flag |= P_NOCLDSTOP; else p->p_procsig->ps_flag &= ~P_NOCLDSTOP; -#endif /* COMPAT_LINUX_THREADS */ if (sa->sa_flags & SA_NOCLDWAIT) { /* * Paranoia: since SA_NOCLDWAIT is implemented by @@ -220,21 +206,11 @@ setsigvec(p, signum, sa) * forbidden to set SA_NOCLDWAIT. */ if (p->p_pid == 1) -#ifndef COMPAT_LINUX_THREADS - p->p_flag &= ~P_NOCLDWAIT; - else - p->p_flag |= P_NOCLDWAIT; -#else p->p_procsig->ps_flag &= ~P_NOCLDWAIT; else p->p_procsig->ps_flag |= P_NOCLDWAIT; -#endif /* COMPAT_LINUX_THREADS */ } else -#ifndef COMPAT_LINUX_THREADS - p->p_flag &= ~P_NOCLDWAIT; -#else p->p_procsig->ps_flag &= ~P_NOCLDWAIT; -#endif /* COMPAT_LINUX_THREADS */ } /* * Set bit in p_sigignore for signals that are set to SIG_IGN, @@ -409,11 +385,7 @@ osigvec(p, uap) if ((ps->ps_signodefer & bit) != 0) sv->sv_flags |= SV_NODEFER; #ifndef COMPAT_SUNOS -#ifndef COMPAT_LINUX_THREADS - if (signum == SIGCHLD && p->p_flag & P_NOCLDSTOP) -#else if (signum == SIGCHLD && p->p_procsig->ps_flag & P_NOCLDSTOP) -#endif /* COMPAT_LINUX_THREADS */ sv->sv_flags |= SV_NOCLDSTOP; #endif if ((error = copyout((caddr_t)sv, (caddr_t)uap->osv, @@ -498,12 +470,7 @@ sigsuspend(p, uap) * save it here and mark the sigacts structure * to indicate this. */ -#ifndef COMPAT_LINUX_THREADS - ps->ps_oldmask = p->p_sigmask; - ps->ps_flags |= SAS_OLDMASK; -#else p->p_oldsigmask = p->p_sigmask; -#endif /* COMPAT_LINUX_THREADS */ p->p_sigmask = uap->mask &~ sigcantmask; while (tsleep((caddr_t) ps, PPAUSE|PCATCH, "pause", 0) == 0) /* void */; @@ -762,13 +729,8 @@ trapsignal(p, signum, code) ps->ps_sigact[signum] = SIG_DFL; } } else { -#ifndef COMPAT_LINUX_THREADS - ps->ps_code = code; /* XXX for core dump/debugger */ - ps->ps_sig = signum; /* XXX to verify code */ -#else p->p_code = code; /* XXX for core dump/debugger */ p->p_sig = signum; /* XXX to verify code */ -#endif /* COMPAT_LINUX_THREADS */ psignal(p, signum); } } @@ -817,11 +779,7 @@ psignal(p, signum) * and if it is set to SIG_IGN, * action will be SIG_DFL here.) */ -#ifndef COMPAT_LINUX_THREADS - if (p->p_sigignore & mask) -#else if ((p->p_sigignore & mask) || (p->p_flag & P_WEXIT)) -#endif /* COMPAT_LINUX_THREADS */ return; if (p->p_sigmask & mask) action = SIG_HOLD; @@ -903,11 +861,7 @@ psignal(p, signum) goto out; p->p_siglist &= ~mask; p->p_xstat = signum; -#ifndef COMPAT_LINUX_THREADS - if ((p->p_pptr->p_flag & P_NOCLDSTOP) == 0) -#else if ((p->p_pptr->p_procsig->ps_flag & P_NOCLDSTOP) == 0) -#endif /* COMPAT_LINUX_THREADS */ psignal(p->p_pptr, SIGCHLD); stop(p); goto out; @@ -1114,11 +1068,7 @@ issignal(p) break; /* == ignore */ p->p_xstat = signum; stop(p); -#ifndef COMPAT_LINUX_THREADS - if ((p->p_pptr->p_flag & P_NOCLDSTOP) == 0) -#else if ((p->p_pptr->p_procsig->ps_flag & P_NOCLDSTOP) == 0) -#endif /* COMPAT_LINUX_THREADS */ psignal(p->p_pptr, SIGCHLD); mi_switch(); break; @@ -1191,13 +1141,8 @@ postsig(signum) #ifdef KTRACE if (KTRPOINT(p, KTR_PSIG)) ktrpsig(p->p_tracep, -#ifndef COMPAT_LINUX_THREADS - signum, action, ps->ps_flags & SAS_OLDMASK ? - ps->ps_oldmask : p->p_sigmask, 0); -#else signum, action, p->p_oldsigmask ? p->p_oldsigmask : p->p_sigmask, 0); -#endif /* COMPAT_LINUX_THREADS */ #endif STOPEVENT(p, S_SIG, signum); @@ -1224,15 +1169,9 @@ postsig(signum) * restored after the signal processing is completed. */ (void) splhigh(); -#ifndef COMPAT_LINUX_THREADS - if (ps->ps_flags & SAS_OLDMASK) { - returnmask = ps->ps_oldmask; - ps->ps_flags &= ~SAS_OLDMASK; -#else if (p->p_oldsigmask) { returnmask = p->p_oldsigmask; p->p_oldsigmask = 0; -#endif /* COMPAT_LINUX_THREADS */ } else returnmask = p->p_sigmask; p->p_sigmask |= ps->ps_catchmask[signum] | @@ -1248,22 +1187,12 @@ postsig(signum) } (void) spl0(); p->p_stats->p_ru.ru_nsignals++; -#ifndef COMPAT_LINUX_THREADS - if (ps->ps_sig != signum) { -#else if (p->p_sig != signum) { -#endif /* COMPAT_LINUX_THREADS */ code = 0; } else { -#ifndef COMPAT_LINUX_THREADS - code = ps->ps_code; - ps->ps_code = 0; - ps->ps_sig = 0; -#else code = p->p_code; p->p_code = 0; p->p_sig = 0; -#endif /* COMPAT_LINUX_THREADS */ } (*p->p_sysent->sv_sendsig)(action, signum, returnmask, code); } @@ -1298,11 +1227,7 @@ sigexit(p, signum) p->p_acflag |= AXSIG; if (sigprop[signum] & SA_CORE) { -#ifndef COMPAT_LINUX_THREADS - p->p_sigacts->ps_sig = signum; -#else p->p_sig = signum; -#endif /* COMPAT_LINUX_THREADS */ /* * Log signals which would cause core dumps * (Log as LOG_INFO to appease those who don't want |