Pure refactor, no functional change. Factor the process-registration
logic out of do_fork into small functions:
- fork_register_proc: PID assignment and insertion into the global process lists (allproc, pidhash, tidhash) and prison
- fork_proc_tree: process group join, parent/reaper attachment
This is preparation for adding a second consumer of this logic: the
pdnew family of syscalls implementing the process creation model
proposed in
https://lists.freebsd.org/archives/freebsd-arch/2022-January/000140.html
Note: This patch overall series is very big, more than I feel competent
reviewing, so I feel a bit ill-mannered submitting it yet. Certainly,
everyone should feel free to ignore it until my "unix socket connectat"
series is landed. I am submitting it now anyway simply because I think
the end functionality is very cool, and I don't want it to grow dusty on
my machine.
Assisted-by: Claude Code (Claude Opus 4.8/5 and Fable 5)