process-util: add FORK_DETACH flag for forking of detached child

A test for this is later added indirectly, via aynchronous_rm_rf() that
uses this and comes with a suitable test.
This commit is contained in:
Lennart Poettering
2023-06-23 10:02:15 +02:00
parent f7bccef178
commit 2e7b105eb9
2 changed files with 35 additions and 2 deletions
+1
View File
@@ -164,6 +164,7 @@ typedef enum ForkFlags {
FORK_NEW_USERNS = 1 << 14, /* Run child in its own user namespace 💣 DO NOT USE IN THREADED PROGRAMS! 💣 */
FORK_CLOEXEC_OFF = 1 << 15, /* In the child: turn off O_CLOEXEC on all fds in except_fds[] */
FORK_KEEP_NOTIFY_SOCKET = 1 << 16, /* Unless this specified, $NOTIFY_SOCKET will be unset. */
FORK_DETACH = 1 << 17, /* Double fork if needed to ensure PID1/subreaper is parent */
} ForkFlags;
int safe_fork_full(