core: add support for pidfd_spawn
Added in glibc 2.39, allows cloning into a cgroup and to get a pid fd back instead of a pid. Removes race conditions for both changing cgroups and getting a reliable reference for the child process. Fixes https://github.com/systemd/systemd/pull/18843 Replaces https://github.com/systemd/systemd/pull/16706
This commit is contained in:
@@ -238,7 +238,7 @@ int get_process_threads(pid_t pid);
|
||||
int is_reaper_process(void);
|
||||
int make_reaper_process(bool b);
|
||||
|
||||
int posix_spawn_wrapper(const char *path, char *const *argv, char *const *envp, PidRef *ret_pidref);
|
||||
int posix_spawn_wrapper(const char *path, char *const *argv, char *const *envp, const char *cgroup, PidRef *ret_pidref);
|
||||
|
||||
int proc_dir_open(DIR **ret);
|
||||
int proc_dir_read(DIR *d, pid_t *ret);
|
||||
|
||||
Reference in New Issue
Block a user