Process reapers

Konstantin Belousov kostikbel at
Mon Dec 1 18:52:44 UTC 2014

Please find at
the patch which adds a way for the process to declare itself a reaper
for the subtree of processes forked after the event.  In other words,
after the process is marked as reaper, all orphaned children somewhere
in subtree after the reaper, are reparented to the process instead of

The API is based on the following DragonFlyBSD commit
Linux has somewhat similar prctl(PR_SET_CHILD_SUBREAPER).
Solaris is most advanced in the area, the feature which provides
the same function is contracts(4), which is very advanced and
IMO over-designed interface.

I did not wrote the man page, the API is still in flux.  It should
be relatively clean how to use the thing by the descriptive names
and comments in header file.  One of the test programs illustrating
the interface is available at .
for the description of DragonFly interface.

The feature was requested by bapt, jilles already provided useful
feedback that was incorporated into the patch.

Please review and comment.

More information about the freebsd-arch mailing list