diff --git a/lib/libc/sys/procctl.2 b/lib/libc/sys/procctl.2 --- a/lib/libc/sys/procctl.2 +++ b/lib/libc/sys/procctl.2 @@ -320,6 +320,8 @@ .It Dv REAPER_PIDINFO_REAPER The reported process is itself a reaper. The descendants of the subordinate reaper are not reported. +.It Dv REAPER_PIDINFO_ZOMBIE +The reported process is in the zombie state, ready to be reaped. .El .It Dv PROC_REAP_KILL Request to deliver a signal to some subset of the descendants of the reaper. diff --git a/sys/kern/kern_procctl.c b/sys/kern/kern_procctl.c --- a/sys/kern/kern_procctl.c +++ b/sys/kern/kern_procctl.c @@ -234,6 +234,8 @@ pip->pi_flags |= REAPER_PIDINFO_CHILD; if ((p2->p_treeflag & P_TREE_REAPER) != 0) pip->pi_flags |= REAPER_PIDINFO_REAPER; + if (p2->p_state == PRS_ZOMBIE) + pip->pi_flags |= REAPER_PIDINFO_ZOMBIE; i++; } sx_sunlock(&proctree_lock); diff --git a/sys/sys/procctl.h b/sys/sys/procctl.h --- a/sys/sys/procctl.h +++ b/sys/sys/procctl.h @@ -102,6 +102,7 @@ #define REAPER_PIDINFO_VALID 0x00000001 #define REAPER_PIDINFO_CHILD 0x00000002 #define REAPER_PIDINFO_REAPER 0x00000004 +#define REAPER_PIDINFO_ZOMBIE 0x00000008 struct procctl_reaper_pids { u_int rp_count;