summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_sig.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/kern_sig.c')
-rw-r--r--sys/kern/kern_sig.c27
1 files changed, 6 insertions, 21 deletions
diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c
index 17fca944c86..c7a5f2623c9 100644
--- a/sys/kern/kern_sig.c
+++ b/sys/kern/kern_sig.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_sig.c,v 1.109 2010/06/28 23:00:30 guenther Exp $ */
+/* $OpenBSD: kern_sig.c,v 1.110 2010/06/29 00:28:14 tedu Exp $ */
/* $NetBSD: kern_sig.c,v 1.54 1996/04/22 01:38:32 christos Exp $ */
/*
@@ -97,12 +97,10 @@ cansignal(struct proc *p, struct pcred *pc, struct proc *q, int signum)
if (p == q)
return (1); /* process can always signal itself */
-#ifdef RTHREADS
/* a thread can only be signalled from within the same process */
if (q->p_flag & P_THREAD) {
return (p->p_p == q->p_p);
}
-#endif
if (signum == SIGCONT && q->p_session == p->p_session)
return (1); /* SIGCONT in session */
@@ -578,7 +576,6 @@ sys_kill(struct proc *cp, void *v, register_t *retval)
if (SCARG(uap, pid) > 0) {
enum signal_type type = SPROCESS;
-#ifdef RTHREADS
if (SCARG(uap, pid) > THREAD_PID_OFFSET) {
if ((p = pfind(SCARG(uap, pid)
- THREAD_PID_OFFSET)) == NULL)
@@ -586,15 +583,11 @@ sys_kill(struct proc *cp, void *v, register_t *retval)
if (p->p_flag & P_THREAD)
return (ESRCH);
type = STHREAD;
- } else
-#endif
- {
+ } else {
if ((p = pfind(SCARG(uap, pid))) == NULL)
return (ESRCH);
-#ifdef RTHREADS
if (p->p_flag & P_THREAD)
type = STHREAD;
-#endif
}
/* kill single process */
@@ -800,9 +793,7 @@ ptsignal(struct proc *p, int signum, enum signal_type type)
int s, prop;
sig_t action;
int mask;
-#ifdef RTHREADS
struct proc *q;
-#endif
int wakeparent = 0;
#ifdef DIAGNOSTIC
@@ -816,7 +807,6 @@ ptsignal(struct proc *p, int signum, enum signal_type type)
mask = sigmask(signum);
-#ifdef RTHREADS
if (type == SPROCESS) {
TAILQ_FOREACH(q, &p->p_p->ps_threads, p_thr_link) {
/* ignore exiting threads */
@@ -830,7 +820,6 @@ ptsignal(struct proc *p, int signum, enum signal_type type)
}
}
}
-#endif
if (type != SPROPAGATED)
KNOTE(&p->p_p->ps_klist, NOTE_SIGNAL | signum);
@@ -842,15 +831,12 @@ ptsignal(struct proc *p, int signum, enum signal_type type)
*/
if (p->p_flag & P_TRACED)
action = SIG_DFL;
-#ifdef RTHREADS
else if (p->p_sigdivert & mask) {
p->p_sigwait = signum;
atomic_clearbits_int(&p->p_sigdivert, ~0);
action = SIG_CATCH;
wakeup(&p->p_sigdivert);
- }
-#endif
- else {
+ } else {
/*
* If the signal is being ignored,
* then we forget about it immediately.
@@ -892,7 +878,6 @@ ptsignal(struct proc *p, int signum, enum signal_type type)
atomic_setbits_int(&p->p_siglist, mask);
-#ifdef RTHREADS
/*
* XXX delay processing of SA_STOP signals unless action == SIG_DFL?
*/
@@ -902,7 +887,6 @@ ptsignal(struct proc *p, int signum, enum signal_type type)
ptsignal(q, signum, SPROPAGATED);
}
}
-#endif
/*
* Defer further processing for signals which are held,
@@ -1550,7 +1534,6 @@ sys_nosys(struct proc *p, void *v, register_t *retval)
return (ENOSYS);
}
-#ifdef RTHREADS
int
sys_thrsigdivert(struct proc *p, void *v, register_t *retval)
{
@@ -1564,6 +1547,9 @@ sys_thrsigdivert(struct proc *p, void *v, register_t *retval)
long long to_ticks = 0;
int error;
+ if (!rthreads_enabled)
+ return (ENOTSUP);
+
m = NULL;
mask = SCARG(uap, sigmask) &~ sigcantmask;
@@ -1618,7 +1604,6 @@ sys_thrsigdivert(struct proc *p, void *v, register_t *retval)
}
return (error);
}
-#endif
void
initsiginfo(siginfo_t *si, int sig, u_long code, int type, union sigval val)