cgroup-util: Don't try to open pidfd for pids from cgroup.threads
Opening pidfds for non thread group leaders only works from 6.9 onwards with PIDFD_THREAD. On older kernels or without PIDFD_THREAD pidfd_open() fails with EINVAL. Since we might read non thread group leader IDs from cgroup.threads, we introduce and set CGROUP_NO_PIDFD to avoid trying open pidfd's for them and instead use the pid as is.
This commit is contained in:
@@ -188,6 +188,7 @@ typedef enum CGroupFlags {
|
||||
CGROUP_IGNORE_SELF = 1 << 1,
|
||||
CGROUP_REMOVE = 1 << 2,
|
||||
CGROUP_DONT_SKIP_UNMAPPED = 1 << 3,
|
||||
CGROUP_NO_PIDFD = 1 << 4,
|
||||
} CGroupFlags;
|
||||
|
||||
int cg_enumerate_processes(const char *controller, const char *path, FILE **ret);
|
||||
|
||||
Reference in New Issue
Block a user