]> git.ipfire.org Git - thirdparty/systemd.git/commit
cgroup-util: Don't try to open pidfd for pids from cgroup.threads 33084/head
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 29 May 2024 20:03:38 +0000 (22:03 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Thu, 30 May 2024 08:30:36 +0000 (10:30 +0200)
commit8783355fd98448c08dae68e80da9580d74ea8687
tree07721cdd68316b714ba51a9d111297ce842996dd
parent9ac8450e7f0a011654e947e996b0df5631e68c23
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.
src/basic/cgroup-util.c
src/basic/cgroup-util.h