Page MenuHomeFreeBSD

procctl: add state flags to PROC_REAP_GETPIDS reports
ClosedPublic

Authored by val_packett.cool on Apr 15 2023, 6:03 PM.
Tags
None
Referenced Files
F137990245: D39585.id120368.diff
Thu, Nov 27, 10:46 PM
Unknown Object (File)
Sun, Nov 23, 12:42 AM
Unknown Object (File)
Thu, Oct 30, 8:59 AM
Unknown Object (File)
Oct 24 2025, 6:15 AM
Unknown Object (File)
Oct 18 2025, 2:34 AM
Unknown Object (File)
Oct 10 2025, 8:21 PM
Unknown Object (File)
Oct 10 2025, 8:19 PM
Unknown Object (File)
Oct 10 2025, 8:26 AM

Details

Summary

For a process supervisor using the reaper API to track process subtrees,
it is very useful to know which processes on the list are zombies.

Sponsored by: https://www.patreon.com/valpackett

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

I do not object. IMO it would make sense to also report stopped and exiting processes too?

Yeah, agreed.

BTW, is the only difference between P_WEXIT and zombie state is that P_WEXIT gets set earlier in the process?

val_packett.cool retitled this revision from procctl: add a REAPER_PIDINFO_ZOMBIE flag to PROC_REAP_GETPIDS reports to procctl: add state flags to PROC_REAP_GETPIDS reports.Apr 15 2023, 8:07 PM

BTW, is the only difference between P_WEXIT and zombie state is that P_WEXIT gets set earlier in the process?

P_WEXIT processes are not zombies (sometimes).

sys/kern/kern_procctl.c
242

Note that P_WEXIT is kept even for zombies, the flag is not cleared on transition. Perhaps it makes sense to not set EXITING flag for processes that already exited.

Yeah, I guess it would make sense to only report "exiting" when not yet exited.

Please mail me git-formatted patch with all metadata. Also please bump the man page date.

This revision is now accepted and ready to land.Apr 15 2023, 9:14 PM