]> git.ipfire.org Git - thirdparty/libcgroup.git/commit
api.c: add support to attach tid to an empty cgroup v2
authorKamalesh Babulal <kamalesh.babulal@oracle.com>
Mon, 4 Apr 2022 06:48:46 +0000 (12:18 +0530)
committerTom Hromatka <tom.hromatka@oracle.com>
Wed, 20 Apr 2022 15:23:33 +0000 (09:23 -0600)
commitfb8a49dc5551165716ff368df593a91b4f422e0d
tree8c5b2c4f3e4d9fcc33a00a74937551db2fa4e0a3
parentc8e694c6f0a1330cdcd11b3601a2a5c58fc00df9
api.c: add support to attach tid to an empty cgroup v2

Currently, cgroup_attach_task_pid() checks for enabled
controllers before attaching the given tid to it, but in the case of
empty cgroup, it simply ignores the attaching due to no controllers
available, a.k.a. cgroup->index is 0.  Add support to recognize empty
controller cgroups.

Fixes: https://github.com/libcgroup/libcgroup/issues/129
Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
src/api.c