summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/cgroup/lib/cgroup_util.c
diff options
context:
space:
mode:
authorMichal Koutný <mkoutny@suse.com>2025-06-17 15:36:53 +0200
committerTejun Heo <tj@kernel.org>2025-06-17 08:13:01 -1000
commit0925275a173d07786bfddf453f629f78d7fc4278 (patch)
treefe5c2e77f3b49bd72600b13c3543a27417b93d26 /tools/testing/selftests/cgroup/lib/cgroup_util.c
parent38b9342ee62e9a1a868654ba6619de9da251bd57 (diff)
selftests: cgroup_util: Add helpers for testing named v1 hierarchies
Non-functional change, the control variable will be wired in a separate commit. Signed-off-by: Michal Koutný <mkoutny@suse.com> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'tools/testing/selftests/cgroup/lib/cgroup_util.c')
-rw-r--r--tools/testing/selftests/cgroup/lib/cgroup_util.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/testing/selftests/cgroup/lib/cgroup_util.c b/tools/testing/selftests/cgroup/lib/cgroup_util.c
index 8832f3d1cb61..0e89fcff4d05 100644
--- a/tools/testing/selftests/cgroup/lib/cgroup_util.c
+++ b/tools/testing/selftests/cgroup/lib/cgroup_util.c
@@ -19,6 +19,8 @@
#include "cgroup_util.h"
#include "../../clone3/clone3_selftests.h"
+bool cg_test_v1_named;
+
/* Returns read len on success, or -errno on failure. */
ssize_t read_text(const char *path, char *buf, size_t max_len)
{
@@ -361,7 +363,7 @@ int cg_enter_current(const char *cgroup)
int cg_enter_current_thread(const char *cgroup)
{
- return cg_write(cgroup, "cgroup.threads", "0");
+ return cg_write(cgroup, CG_THREADS_FILE, "0");
}
int cg_run(const char *cgroup,