Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/kern_sig.c
Show First 20 Lines • Show All 3,060 Lines • ▼ Show 20 Lines | if (p->p_sig == sig) { | ||||
p->p_sig = 0; | p->p_sig = 0; | ||||
} | } | ||||
(*p->p_sysent->sv_sendsig)(action, &ksi, &returnmask); | (*p->p_sysent->sv_sendsig)(action, &ksi, &returnmask); | ||||
postsig_done(sig, td, ps); | postsig_done(sig, td, ps); | ||||
} | } | ||||
return (1); | return (1); | ||||
} | } | ||||
void | |||||
proc_wkilled(struct proc *p) | |||||
{ | |||||
PROC_LOCK_ASSERT(p, MA_OWNED); | |||||
if ((p->p_flag & P_WKILLED) == 0) { | |||||
p->p_flag |= P_WKILLED; | |||||
/* | /* | ||||
* Notify swapper that there is a process to swap in. | |||||
* The notification is racy, at worst it would take 10 | |||||
* seconds for the swapper process to notice. | |||||
*/ | |||||
wakeup(&proc0); | |||||
} | |||||
} | |||||
/* | |||||
* Kill the current process for stated reason. | * Kill the current process for stated reason. | ||||
*/ | */ | ||||
void | void | ||||
killproc(struct proc *p, char *why) | killproc(struct proc *p, char *why) | ||||
{ | { | ||||
PROC_LOCK_ASSERT(p, MA_OWNED); | PROC_LOCK_ASSERT(p, MA_OWNED); | ||||
CTR3(KTR_PROC, "killproc: proc %p (pid %d, %s)", p, p->p_pid, | CTR3(KTR_PROC, "killproc: proc %p (pid %d, %s)", p, p->p_pid, | ||||
p->p_comm); | p->p_comm); | ||||
log(LOG_ERR, "pid %d (%s), uid %d, was killed: %s\n", p->p_pid, | log(LOG_ERR, "pid %d (%s), uid %d, was killed: %s\n", p->p_pid, | ||||
p->p_comm, p->p_ucred ? p->p_ucred->cr_uid : -1, why); | p->p_comm, p->p_ucred ? p->p_ucred->cr_uid : -1, why); | ||||
p->p_flag |= P_WKILLED; | proc_wkilled(p); | ||||
kern_psignal(p, SIGKILL); | kern_psignal(p, SIGKILL); | ||||
} | } | ||||
/* | /* | ||||
* Force the current process to exit with the specified signal, dumping core | * Force the current process to exit with the specified signal, dumping core | ||||
* if appropriate. We bypass the normal tests for masked and caught signals, | * if appropriate. We bypass the normal tests for masked and caught signals, | ||||
* allowing unrecoverable failures to terminate the process without changing | * allowing unrecoverable failures to terminate the process without changing | ||||
* signal state. Mark the accounting record with the signal termination. | * signal state. Mark the accounting record with the signal termination. | ||||
▲ Show 20 Lines • Show All 727 Lines • Show Last 20 Lines |