-/* $OpenBSD: kern_sig.c,v 1.339 2024/10/01 08:28:34 claudio Exp $ */
+/* $OpenBSD: kern_sig.c,v 1.340 2024/10/09 08:39:49 claudio Exp $ */
/* $NetBSD: kern_sig.c,v 1.54 1996/04/22 01:38:32 christos Exp $ */
/*
ptsignal(p, signum, SPROCESS);
}
+void
+prsignal(struct process *pr, int signum)
+{
+ /* Ignore signal if the target process is exiting */
+ if (pr->ps_flags & PS_EXITING) {
+ return;
+ }
+ ptsignal(TAILQ_FIRST(&pr->ps_threads), signum, SPROCESS);
+}
+
/*
* type = SPROCESS process signal, can be diverted (sigwait())
* type = STHREAD thread signal, but should be propagated if unhandled
-/* $OpenBSD: signalvar.h,v 1.54 2022/05/13 15:32:00 claudio Exp $ */
+/* $OpenBSD: signalvar.h,v 1.55 2024/10/09 08:39:49 claudio Exp $ */
/* $NetBSD: signalvar.h,v 1.17 1996/04/22 01:23:31 christos Exp $ */
/*
void pgsignal(struct pgrp *pgrp, int sig, int checkctty);
void psignal(struct proc *p, int sig);
void ptsignal(struct proc *p, int sig, enum signal_type type);
-#define prsignal(pr,sig) ptsignal((pr)->ps_mainproc, (sig), SPROCESS)
+void prsignal(struct process *pr, int sig);
void trapsignal(struct proc *p, int sig, u_long code, int type,
union sigval val);
__dead void sigexit(struct proc *, int);