[PATCH 4/4] selftests: cgroup: Fix compilation on pre-cgroupns kernels
From: Michal Koutný
Date: Tue Jun 17 2025 - 09:38:16 EST
The test would be skipped because of nsdelegate, so the defined value is
not used (0 is always acceptable).
Signed-off-by: Michal Koutný <mkoutny@xxxxxxxx>
---
tools/testing/selftests/cgroup/test_core.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/tools/testing/selftests/cgroup/test_core.c b/tools/testing/selftests/cgroup/test_core.c
index 452c2abf9794e..a360e2eb2eefd 100644
--- a/tools/testing/selftests/cgroup/test_core.c
+++ b/tools/testing/selftests/cgroup/test_core.c
@@ -21,6 +21,9 @@
#include "cgroup_util.h"
static bool nsdelegate;
+#ifndef CLONE_NEWCGROUP
+#define CLONE_NEWCGROUP 0
+#endif
static int touch_anon(char *buf, size_t size)
{
--
2.49.0