Expose process reaper metadata through struct kinfo_proc so userland can reconstruct reaper hierarchies from kern.proc.all without adding a new procctl(2) operation.
The patch adds two pid_t fields consuming the two remaining KI_NSPARE_INT slots (KI_NSPARE_INT 2->0), without changing sizeof(struct kinfo_proc):
- ki_reaper: PID of the owning reaper process
- ki_reapsubtree: PID of the direct child of the reaper that roots the subtree the process belongs to
Updated components:
- sys/sys/user.h: add the new kinfo_proc fields
- sys/kern/kern_proc.c: populate the fields in fill_kinfo_proc_pgrp()
- lib/libkvm/kvm_proc.c: update crash dump consumers
- sys/compat/freebsd32/freebsd32.h and freebsd32_kinfo_proc_out(): update 32-bit compat layout and conversion
The implementation follows the existing kern.proc.all snapshot model. The values are populated while the sysctl path holds proctree_lock shared, and NULL reaper pointers fall back to NO_PID.
Tested locally with a small userland program covering baseline state, PROC_REAP_ACQUIRE, direct-child subtree tracking, and reparenting after PROC_REAP_RELEASE.
Bugzilla PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293871