kernel - Add reapctl() system call for managing sub-processes
* Add reapctl(). This system call allows the current process to become
the designated reaper for all sub-processes that are directly or indirectly
forked under it, even if they detach.
Instead of reparenting to init, related sub-processes will reparent to
up the tree to the nearest process with reaping management enabled.
* The system call can be run by any user. Multiple processes in the
running topology can be reap masters for the processes under them,
include sub-processes being reap-masters for processes under them,
recursively.
* The system call provides an easy way to ensure that all processes under
the current process, when it is a reap master, to be killed. The first
child pid under management can be queried, killed, waited upon, and the
service monitor then simply loops until no children remain.
Normally this information might not be available or require a 'ps' style
(expensive) run to obtain. This way it can be done trivially and
dependably via reapctl().
14 files changed: