+killproc(p, why)
+ struct proc *p;
+ char *why;
+{
+
+ log(LOG_ERR, "pid %d was killed: %s\n", p->p_pid, why);
+ uprintf("sorry, pid %d was killed: %s\n", p->p_pid, why);
+ psignal(p, SIGKILL);
+}
+
+/*
+ * Force the current process to exit with the specified signal, dumping core
+ * if appropriate. We bypass the normal tests for masked and caught signals,
+ * allowing unrecoverable failures to terminate the process without changing
+ * signal state. Mark the accounting record with the signal termination.
+ * If dumping core, save the signal number for the debugger. Calls exit and
+ * does not return.
+ */
+sigexit(p, signum)
+ register struct proc *p;
+ int signum;
+{
+
+ p->p_acflag |= AXSIG;
+ if (sigprop[signum] & SA_CORE) {
+ p->p_sigacts->ps_sig = signum;
+ if (coredump(p) == 0)
+ signum |= WCOREFLAG;
+ }
+ exit1(p, W_EXITCODE(0, signum));
+ /* NOTREACHED */
+}
+
+/*
+ * Dump core, into a file named "progname.core", unless the process was
+ * setuid/setgid.
+ */
+coredump(p)
+ register struct proc *p;