@@ -345,13 +345,13 @@ int cg_run(const char *cgroup,
}
}
-pid_t clone_into_cgroup(int cgroup_fd)
+pid_t clone_into_cgroup(int cgroup_fd, unsigned long extra_flags)
{
#ifdef CLONE_ARGS_SIZE_VER2
pid_t pid;
struct __clone_args args = {
- .flags = CLONE_INTO_CGROUP,
+ .flags = CLONE_INTO_CGROUP | extra_flags,
.exit_signal = SIGCHLD,
.cgroup = cgroup_fd,
};
@@ -429,7 +429,7 @@ static int clone_into_cgroup_run_nowait(const char *cgroup,
if (cgroup_fd < 0)
return -1;
- pid = clone_into_cgroup(cgroup_fd);
+ pid = clone_into_cgroup(cgroup_fd, 0);
close_prot_errno(cgroup_fd);
if (pid == 0)
exit(fn(cgroup, arg));
@@ -588,7 +588,7 @@ int clone_into_cgroup_run_wait(const char *cgroup)
if (cgroup_fd < 0)
return -1;
- pid = clone_into_cgroup(cgroup_fd);
+ pid = clone_into_cgroup(cgroup_fd, 0);
close_prot_errno(cgroup_fd);
if (pid < 0)
return -1;
@@ -57,7 +57,7 @@ extern int cg_killall(const char *cgroup);
int proc_mount_contains(const char *option);
extern ssize_t proc_read_text(int pid, bool thread, const char *item, char *buf, size_t size);
extern int proc_read_strstr(int pid, bool thread, const char *item, const char *needle);
-extern pid_t clone_into_cgroup(int cgroup_fd);
+extern pid_t clone_into_cgroup(int cgroup_fd, unsigned long extra_flags);
extern int clone_reap(pid_t pid, int options);
extern int clone_into_cgroup_run_wait(const char *cgroup);
extern int dirfd_open_opath(const char *dir);
@@ -201,7 +201,7 @@ static int test_cgcore_populated(const char *root)
if (cgroup_fd < 0)
goto cleanup;
- pid = clone_into_cgroup(cgroup_fd);
+ pid = clone_into_cgroup(cgroup_fd, 0);
if (pid < 0) {
if (errno == ENOSYS)
goto cleanup_pass;
@@ -233,7 +233,7 @@ static int test_cgcore_populated(const char *root)
cg_test_d = NULL;
}
- pid = clone_into_cgroup(cgroup_fd);
+ pid = clone_into_cgroup(cgroup_fd, 0);
if (pid < 0)
goto cleanup_pass;
if (pid == 0)