Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/kern_sig.c
Show First 20 Lines • Show All 2,221 Lines • ▼ Show 20 Lines | if (prop & SIGPROP_CONT) | ||||
sigqueue_delete_stopmask_proc(p); | sigqueue_delete_stopmask_proc(p); | ||||
else if (prop & SIGPROP_STOP) { | else if (prop & SIGPROP_STOP) { | ||||
/* | /* | ||||
* If sending a tty stop signal to a member of an orphaned | * If sending a tty stop signal to a member of an orphaned | ||||
* process group, discard the signal here if the action | * process group, discard the signal here if the action | ||||
* is default; don't stop the process below if sleeping, | * is default; don't stop the process below if sleeping, | ||||
* and don't clear any pending SIGCONT. | * and don't clear any pending SIGCONT. | ||||
*/ | */ | ||||
if ((prop & SIGPROP_TTYSTOP) && | if ((prop & SIGPROP_TTYSTOP) != 0 && | ||||
(p->p_pgrp->pg_jobc == 0) && | (p->p_pgrp->pg_flags & PGRP_ORPHANED) != 0 && | ||||
(action == SIG_DFL)) { | action == SIG_DFL) { | ||||
if (ksi && (ksi->ksi_flags & KSI_INS)) | if (ksi && (ksi->ksi_flags & KSI_INS)) | ||||
ksiginfo_tryfree(ksi); | ksiginfo_tryfree(ksi); | ||||
return (ret); | return (ret); | ||||
} | } | ||||
sigqueue_delete_proc(p, SIGCONT); | sigqueue_delete_proc(p, SIGCONT); | ||||
if (p->p_flag & P_CONTINUED) { | if (p->p_flag & P_CONTINUED) { | ||||
p->p_flag &= ~P_CONTINUED; | p->p_flag &= ~P_CONTINUED; | ||||
PROC_LOCK(p->p_pptr); | PROC_LOCK(p->p_pptr); | ||||
▲ Show 20 Lines • Show All 738 Lines • ▼ Show 20 Lines | #endif | ||||
/* | /* | ||||
* If there is a pending stop signal to process with | * If there is a pending stop signal to process with | ||||
* default action, stop here, then clear the signal. | * default action, stop here, then clear the signal. | ||||
* Traced or exiting processes should ignore stops. | * Traced or exiting processes should ignore stops. | ||||
* Additionally, a member of an orphaned process group | * Additionally, a member of an orphaned process group | ||||
* should ignore tty stops. | * should ignore tty stops. | ||||
*/ | */ | ||||
if (prop & SIGPROP_STOP) { | if (prop & SIGPROP_STOP) { | ||||
if (p->p_flag & | mtx_unlock(&ps->ps_mtx); | ||||
(P_TRACED | P_WEXIT | P_SINGLE_EXIT) || | if ((p->p_flag & (P_TRACED | P_WEXIT | | ||||
(p->p_pgrp->pg_jobc == 0 && | P_SINGLE_EXIT)) != 0 || ((p->p_pgrp-> | ||||
prop & SIGPROP_TTYSTOP)) | pg_flags & PGRP_ORPHANED) != 0 && | ||||
(prop & SIGPROP_TTYSTOP) != 0)) { | |||||
mtx_lock(&ps->ps_mtx); | |||||
break; /* == ignore */ | break; /* == ignore */ | ||||
} | |||||
if (TD_SBDRY_INTR(td)) { | if (TD_SBDRY_INTR(td)) { | ||||
KASSERT((td->td_flags & TDF_SBDRY) != 0, | KASSERT((td->td_flags & TDF_SBDRY) != 0, | ||||
("lost TDF_SBDRY")); | ("lost TDF_SBDRY")); | ||||
mtx_lock(&ps->ps_mtx); | |||||
return (-1); | return (-1); | ||||
} | } | ||||
mtx_unlock(&ps->ps_mtx); | |||||
WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, | WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, | ||||
&p->p_mtx.lock_object, "Catching SIGSTOP"); | &p->p_mtx.lock_object, "Catching SIGSTOP"); | ||||
sigqueue_delete(&td->td_sigqueue, sig); | sigqueue_delete(&td->td_sigqueue, sig); | ||||
sigqueue_delete(&p->p_sigqueue, sig); | sigqueue_delete(&p->p_sigqueue, sig); | ||||
p->p_flag |= P_STOPPED_SIG; | p->p_flag |= P_STOPPED_SIG; | ||||
p->p_xsig = sig; | p->p_xsig = sig; | ||||
PROC_SLOCK(p); | PROC_SLOCK(p); | ||||
sig_suspend_threads(td, p, 0); | sig_suspend_threads(td, p, 0); | ||||
▲ Show 20 Lines • Show All 1,245 Lines • Show Last 20 Lines |