+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, sig)
+ register struct proc *p;
+ int sig;
+{
+
+ p->p_acflag |= AXSIG;
+ if (sigprop[sig] & SA_CORE) {
+ p->p_sigacts->ps_sig = sig;
+ if (coredump(p) == 0)
+ sig |= WCOREFLAG;
+ }
+ exit1(p, W_EXITCODE(0, sig));
+ /* NOTREACHED */
+}
+
+/*
+ * Create a core dump.
+ * The file name is "core.progname".
+ * Core dumps are not created if the process is setuid.
+ */
+coredump(p)
+ register struct proc *p;