-/* $OpenBSD: kern_exit.c,v 1.238 2024/10/15 11:54:07 claudio Exp $ */
+/* $OpenBSD: kern_exit.c,v 1.239 2024/10/15 13:49:26 claudio Exp $ */
/* $NetBSD: kern_exit.c,v 1.39 1996/04/22 01:38:25 christos Exp $ */
/*
{
int nfound;
struct process *pr;
- struct proc *p;
int error;
if (info != NULL)
(idtype == P_PGID && id != pr->ps_pgid))
continue;
- p = pr->ps_mainproc;
-
nfound++;
if ((options & WEXITED) && (pr->ps_flags & PS_ZOMBIE)) {
*retval = pr->ps_pid;
memset(rusage, 0, sizeof(*rusage));
return (0);
}
- if (p->p_stat == SSTOP &&
+ if (((pr->ps_flags & PS_TRACED) || (options & WUNTRACED)) &&
(pr->ps_flags & PS_WAITED) == 0 &&
- (p->p_flag & P_SUSPSINGLE) == 0 &&
- ((pr->ps_flags & PS_TRACED) ||
- (options & WUNTRACED))) {
+ (pr->ps_flags & PS_STOPPED)) {
if ((options & WNOWAIT) == 0)
atomic_setbits_int(&pr->ps_flags, PS_WAITED);
-/* $OpenBSD: kern_proc.c,v 1.99 2024/07/08 13:17:12 claudio Exp $ */
+/* $OpenBSD: kern_proc.c,v 1.100 2024/10/15 13:49:26 claudio Exp $ */
/* $NetBSD: kern_proc.c,v 1.14 1996/02/09 18:59:41 christos Exp $ */
/*
struct process *pr;
LIST_FOREACH(pr, &pg->pg_members, ps_pglist) {
- if (pr->ps_mainproc->p_stat == SSTOP) {
+ if (pr->ps_flags & PS_STOPPED) {
LIST_FOREACH(pr, &pg->pg_members, ps_pglist) {
prsignal(pr, SIGHUP);
prsignal(pr, SIGCONT);
-/* $OpenBSD: kern_sig.c,v 1.341 2024/10/09 08:58:19 claudio Exp $ */
+/* $OpenBSD: kern_sig.c,v 1.342 2024/10/15 13:49:26 claudio Exp $ */
/* $NetBSD: kern_sig.c,v 1.54 1996/04/22 01:38:32 christos Exp $ */
/*
* Otherwise, process goes back to sleep state.
*/
atomic_setbits_int(&pr->ps_flags, PS_CONTINUED);
+ atomic_clearbits_int(&pr->ps_flags,
+ PS_WAITED | PS_STOPPED);
atomic_clearbits_int(&p->p_flag, P_SUSPSIG);
wakeparent = 1;
if (action == SIG_DFL)
LIST_FOREACH(pr, &allprocess, ps_list) {
if ((pr->ps_flags & PS_STOPPING) == 0)
continue;
+ atomic_setbits_int(&pr->ps_flags, PS_STOPPED);
atomic_clearbits_int(&pr->ps_flags, PS_STOPPING);
if ((pr->ps_pptr->ps_sigacts->ps_sigflags & SAS_NOCLDSTOP) == 0)
-/* $OpenBSD: proc.h,v 1.374 2024/10/08 12:02:24 claudio Exp $ */
+/* $OpenBSD: proc.h,v 1.375 2024/10/15 13:49:26 claudio Exp $ */
/* $NetBSD: proc.h,v 1.44 1996/04/22 01:23:21 christos Exp $ */
/*-
#define PS_NOBTCFI 0x02000000 /* No Branch Target CFI */
#define PS_ITIMER 0x04000000 /* Virtual interval timers running */
#define PS_CONTINUED 0x20000000 /* Continued proc not yet waited for */
+#define PS_STOPPED 0x40000000 /* Stopped process */
#define PS_BITS \
("\20" "\01CONTROLT" "\02EXEC" "\03INEXEC" "\04EXITING" "\05SUGID" \
"\06SUGIDEXEC" "\07PPWAIT" "\010ISPWAIT" "\011PROFIL" "\012TRACED" \
"\013WAITED" "\014COREDUMP" "\015SINGLEEXIT" "\016SINGLEUNWIND" \
- "\017NOZOMBIE" "\020STOPPED" "\021SYSTEM" "\022EMBRYO" "\023ZOMBIE" \
+ "\017NOZOMBIE" "\020STOPPING" "\021SYSTEM" "\022EMBRYO" "\023ZOMBIE" \
"\024NOBROADCASTKILL" "\025PLEDGE" "\026WXNEEDED" "\027EXECPLEDGE" \
- "\030ORPHAN" "\031CHROOT" "\032NOBTCFI" "\033ITIMER" "\034PIN" \
- "\035LIBCPIN" "\036CONTINUED")
+ "\030ORPHAN" "\031CHROOT" "\032NOBTCFI" "\033ITIMER" "\036CONTINUED" \
+ "\037STOPPED")
struct kcov_dev;
struct lock_list_entry;