]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
cgroup-util: drop 'controller' argument from cg_get_path()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 29 Aug 2025 23:38:59 +0000 (08:38 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 17 Nov 2025 12:31:50 +0000 (21:31 +0900)
The argument is not used anymore. Let's drop it.

19 files changed:
src/basic/cgroup-util.c
src/basic/cgroup-util.h
src/basic/process-util.c
src/cgtop/cgtop.c
src/core/bpf-devices.c
src/core/bpf-firewall.c
src/core/bpf-foreign.c
src/core/bpf-restrict-ifaces.c
src/core/bpf-socket-bind.c
src/core/cgroup.c
src/core/exec-invoke.c
src/machine/machine.c
src/nspawn/nspawn-cgroup.c
src/oom/oomd-util.c
src/shared/cgroup-setup.c
src/shared/cgroup-show.c
src/shared/condition.c
src/test/test-bpf-devices.c
src/test/test-cgroup-setup.c

index b01b7b6a3fbd890fe94a5662f18b9f1e43fa2970..2dfc9188fe0b05c2b9275499564ce013ec15feef 100644 (file)
@@ -67,7 +67,7 @@ int cg_path_open(const char *path) {
         _cleanup_free_ char *fs = NULL;
         int r;
 
-        r = cg_get_path(SYSTEMD_CGROUP_CONTROLLER, path, /* suffix= */ NULL, &fs);
+        r = cg_get_path(path, /* suffix= */ NULL, &fs);
         if (r < 0)
                 return r;
 
@@ -137,7 +137,7 @@ int cg_enumerate_processes(const char *path, FILE **ret) {
 
         assert(ret);
 
-        r = cg_get_path(SYSTEMD_CGROUP_CONTROLLER, path, "cgroup.procs", &fs);
+        r = cg_get_path(path, "cgroup.procs", &fs);
         if (r < 0)
                 return r;
 
@@ -241,7 +241,7 @@ int cg_enumerate_subgroups(const char *path, DIR **ret) {
 
         /* This is not recursive! */
 
-        r = cg_get_path(SYSTEMD_CGROUP_CONTROLLER, path, NULL, &fs);
+        r = cg_get_path(path, /* suffix = */ NULL, &fs);
         if (r < 0)
                 return r;
 
@@ -444,7 +444,7 @@ int cg_kill_kernel_sigkill(const char *path) {
         if (!cg_kill_supported())
                 return -EOPNOTSUPP;
 
-        r = cg_get_path(SYSTEMD_CGROUP_CONTROLLER, path, "cgroup.kill", &killfile);
+        r = cg_get_path(path, "cgroup.kill", &killfile);
         if (r < 0)
                 return r;
 
@@ -455,7 +455,7 @@ int cg_kill_kernel_sigkill(const char *path) {
         return 0;
 }
 
-int cg_get_path(const char *controller, const char *path, const char *suffix, char **ret) {
+int cg_get_path(const char *path, const char *suffix, char **ret) {
         char *t;
 
         assert(ret);
@@ -463,10 +463,7 @@ int cg_get_path(const char *controller, const char *path, const char *suffix, ch
         if (isempty(path))
                 path = TAKE_PTR(suffix);
 
-        if (controller)
-                t = path_join("/sys/fs/cgroup", path, suffix);
-        else
-                t = path_join(path, suffix);
+        t = path_join("/sys/fs/cgroup", path, suffix);
         if (!t)
                 return -ENOMEM;
 
@@ -482,7 +479,7 @@ int cg_set_xattr(const char *path, const char *name, const void *value, size_t s
         assert(name);
         assert(value || size <= 0);
 
-        r = cg_get_path(SYSTEMD_CGROUP_CONTROLLER, path, NULL, &fs);
+        r = cg_get_path(path, /* suffix = */ NULL, &fs);
         if (r < 0)
                 return r;
 
@@ -496,7 +493,7 @@ int cg_get_xattr(const char *path, const char *name, char **ret, size_t *ret_siz
         assert(path);
         assert(name);
 
-        r = cg_get_path(SYSTEMD_CGROUP_CONTROLLER, path, NULL, &fs);
+        r = cg_get_path(path, /* suffix = */ NULL, &fs);
         if (r < 0)
                 return r;
 
@@ -510,7 +507,7 @@ int cg_get_xattr_bool(const char *path, const char *name) {
         assert(path);
         assert(name);
 
-        r = cg_get_path(SYSTEMD_CGROUP_CONTROLLER, path, NULL, &fs);
+        r = cg_get_path(path, /* suffix = */ NULL, &fs);
         if (r < 0)
                 return r;
 
@@ -524,7 +521,7 @@ int cg_remove_xattr(const char *path, const char *name) {
         assert(path);
         assert(name);
 
-        r = cg_get_path(SYSTEMD_CGROUP_CONTROLLER, path, NULL, &fs);
+        r = cg_get_path(path, /* suffix = */ NULL, &fs);
         if (r < 0)
                 return r;
 
@@ -691,7 +688,7 @@ int cg_split_spec(const char *spec, char **ret_controller, char **ret_path) {
 }
 
 int cg_mangle_path(const char *path, char **ret) {
-        _cleanup_free_ char *c = NULL, *p = NULL;
+        _cleanup_free_ char *p = NULL;
         int r;
 
         assert(path);
@@ -702,11 +699,11 @@ int cg_mangle_path(const char *path, char **ret) {
                 return path_simplify_alloc(path, ret);
 
         /* Otherwise, treat it as cg spec */
-        r = cg_split_spec(path, &c, &p);
+        r = cg_split_spec(path, /* ret_controller = */ NULL, &p);
         if (r < 0)
                 return r;
 
-        return cg_get_path(c ?: SYSTEMD_CGROUP_CONTROLLER, p ?: "/", NULL, ret);
+        return cg_get_path(p, /* suffix = */ NULL, ret);
 }
 
 int cg_get_root_path(char **ret_path) {
@@ -1439,7 +1436,7 @@ int cg_is_threaded(const char *path) {
         _cleanup_strv_free_ char **v = NULL;
         int r;
 
-        r = cg_get_path(SYSTEMD_CGROUP_CONTROLLER, path, "cgroup.type", &fs);
+        r = cg_get_path(path, "cgroup.type", &fs);
         if (r < 0)
                 return r;
 
@@ -1464,7 +1461,7 @@ int cg_set_attribute(const char *path, const char *attribute, const char *value)
 
         assert(attribute);
 
-        r = cg_get_path(SYSTEMD_CGROUP_CONTROLLER, path, attribute, &p);
+        r = cg_get_path(path, attribute, &p);
         if (r < 0)
                 return r;
 
@@ -1482,7 +1479,7 @@ int cg_get_attribute(const char *path, const char *attribute, char **ret) {
 
         assert(attribute);
 
-        r = cg_get_path(SYSTEMD_CGROUP_CONTROLLER, path, attribute, &p);
+        r = cg_get_path(path, attribute, &p);
         if (r < 0)
                 return r;
 
@@ -1535,7 +1532,7 @@ int cg_get_owner(const char *path, uid_t *ret_uid) {
 
         assert(ret_uid);
 
-        r = cg_get_path(SYSTEMD_CGROUP_CONTROLLER, path, NULL, &f);
+        r = cg_get_path(path, /* suffix = */ NULL, &f);
         if (r < 0)
                 return r;
 
@@ -1569,7 +1566,7 @@ int cg_get_keyed_attribute(
          *
          * If the attribute file doesn't exist at all returns ENOENT, if any key is not found returns ENXIO. */
 
-        r = cg_get_path(SYSTEMD_CGROUP_CONTROLLER, path, attribute, &filename);
+        r = cg_get_path(path, attribute, &filename);
         if (r < 0)
                 return r;
 
@@ -1714,7 +1711,7 @@ int cg_mask_supported_subtree(const char *root, CGroupMask *ret) {
 
         /* We can read the supported and accessible controllers from the top-level cgroup attribute */
         _cleanup_free_ char *controllers = NULL, *path = NULL;
-        r = cg_get_path(SYSTEMD_CGROUP_CONTROLLER, root, "cgroup.controllers", &path);
+        r = cg_get_path(root, "cgroup.controllers", &path);
         if (r < 0)
                 return r;
 
index 9c534ac594c181e68dc0f3a61efd7c5427ee179d..b25660c086a413cffe33ee994c8fb865c049e923 100644 (file)
@@ -164,7 +164,7 @@ int cg_kill_recursive(const char *path, int sig, CGroupFlags flags, Set *killed_
 int cg_split_spec(const char *spec, char **ret_controller, char **ret_path);
 int cg_mangle_path(const char *path, char **ret);
 
-int cg_get_path(const char *controller, const char *path, const char *suffix, char **ret);
+int cg_get_path(const char *path, const char *suffix, char **ret);
 
 int cg_pid_get_path(pid_t pid, char **ret);
 int cg_pidref_get_path(const PidRef *pidref, char **ret);
index 900e885bfaca046aea12d9f61c5d4ab07d4a052e..5759de38f4c4f36165079aeced282d9e7a680894 100644 (file)
@@ -2146,7 +2146,7 @@ int posix_spawn_wrapper(
         if (cgroup && have_clone_into_cgroup) {
                 _cleanup_free_ char *resolved_cgroup = NULL;
 
-                r = cg_get_path(SYSTEMD_CGROUP_CONTROLLER, cgroup, /* suffix= */ NULL, &resolved_cgroup);
+                r = cg_get_path(cgroup, /* suffix= */ NULL, &resolved_cgroup);
                 if (r < 0)
                         return r;
 
index 99f1fe22aef33aeaf2b1bcf06c610da9ac5575f0..87806caeba1bc7b9831faef61dbc8fdd6a3585b3 100644 (file)
@@ -172,7 +172,7 @@ static int process_memory(Group *g) {
         else {
                 _cleanup_free_ char *p = NULL, *v = NULL;
 
-                r = cg_get_path(SYSTEMD_CGROUP_CONTROLLER, g->path, "memory.current", &p);
+                r = cg_get_path(g->path, "memory.current", &p);
                 if (r < 0)
                         return r;
 
@@ -202,7 +202,7 @@ static int process_io(Group *g, unsigned iteration) {
 
         assert(g);
 
-        r = cg_get_path(SYSTEMD_CGROUP_CONTROLLER, g->path, "io.stat", &p);
+        r = cg_get_path(g->path, "io.stat", &p);
         if (r < 0)
                 return r;
 
@@ -395,7 +395,7 @@ static int process(
                 } else {
                         _cleanup_free_ char *p = NULL, *v = NULL;
 
-                        r = cg_get_path(SYSTEMD_CGROUP_CONTROLLER, path, "pids.current", &p);
+                        r = cg_get_path(path, "pids.current", &p);
                         if (r < 0)
                                 return r;
 
index ef8ba3d57230d65ef51cbae9850401b20eeac93d..71ffd048986f51d6f89e8554104e9e6ae1aadbe8 100644 (file)
@@ -236,7 +236,7 @@ int bpf_devices_apply_policy(
         if (r < 0)
                 return log_error_errno(r, "Extending device control BPF program failed: %m");
 
-        r = cg_get_path(SYSTEMD_CGROUP_CONTROLLER, cgroup_path, NULL, &controller_path);
+        r = cg_get_path(cgroup_path, /* suffix = */ NULL, &controller_path);
         if (r < 0)
                 return log_error_errno(r, "Failed to determine cgroup path: %m");
 
index fce885da875f6439441eb24566ecbd2dc96fa661..b2a4cd6e27b7700856040dc28e5f27881180e9b1 100644 (file)
@@ -696,7 +696,7 @@ int bpf_firewall_install(Unit *u) {
                 return log_unit_debug_errno(u, SYNTHETIC_ERRNO(EOPNOTSUPP),
                                             "bpf-firewall: BPF firewalling not supported, proceeding without.");
 
-        r = cg_get_path(SYSTEMD_CGROUP_CONTROLLER, crt->cgroup_path, NULL, &path);
+        r = cg_get_path(crt->cgroup_path, /* suffix = */ NULL, &path);
         if (r < 0)
                 return log_unit_error_errno(u, r, "bpf-firewall: Failed to determine cgroup path: %m");
 
index 2e8c07978ce6fec7364518f3c4e452a3c601f8b3..1da16a7b8d933951b454061920c41866200375d8 100644 (file)
@@ -151,7 +151,7 @@ int bpf_foreign_install(Unit *u) {
         if (!crt)
                 return 0;
 
-        r = cg_get_path(SYSTEMD_CGROUP_CONTROLLER, crt->cgroup_path, NULL, &cgroup_path);
+        r = cg_get_path(crt->cgroup_path, /* suffix = */ NULL, &cgroup_path);
         if (r < 0)
                 return log_unit_error_errno(u, r, "bpf-foreign: Failed to get cgroup path: %m");
 
index 0c66ae06308862a2335d04ad4bbc5a455953de80..a0ed94ce3ad02c099bfd5e9eebd5dded808e89b7 100644 (file)
@@ -115,7 +115,7 @@ static int restrict_ifaces_install_impl(Unit *u) {
         if (!crt)
                 return 0;
 
-        r = cg_get_path(SYSTEMD_CGROUP_CONTROLLER, crt->cgroup_path, NULL, &cgroup_path);
+        r = cg_get_path(crt->cgroup_path, /* suffix = */ NULL, &cgroup_path);
         if (r < 0)
                 return log_unit_error_errno(u, r, "restrict-interfaces: Failed to get cgroup path: %m");
 
index 1fc73c19ab711badfd7af698ce57813942dc54ef..1cba47306d90ae82136d1e1eebabe45037d00d7b 100644 (file)
@@ -179,7 +179,7 @@ static int socket_bind_install_impl(Unit *u) {
         if (!crt)
                 return 0;
 
-        r = cg_get_path(SYSTEMD_CGROUP_CONTROLLER, crt->cgroup_path, NULL, &cgroup_path);
+        r = cg_get_path(crt->cgroup_path, /* suffix = */ NULL, &cgroup_path);
         if (r < 0)
                 return log_unit_error_errno(u, r, "bpf-socket-bind: Failed to get cgroup path: %m");
 
index 6f3e61ea3af072edd6e435d2cb9cd74d91f418d1..7242734e5ae88de8095c062062a3957958ec60bc 100644 (file)
@@ -1989,7 +1989,7 @@ static int unit_watch_cgroup(Unit *u) {
         if (r < 0)
                 return log_oom();
 
-        r = cg_get_path(SYSTEMD_CGROUP_CONTROLLER, crt->cgroup_path, "cgroup.events", &events);
+        r = cg_get_path(crt->cgroup_path, "cgroup.events", &events);
         if (r < 0)
                 return log_oom();
 
@@ -2044,7 +2044,7 @@ static int unit_watch_cgroup_memory(Unit *u) {
         if (r < 0)
                 return log_oom();
 
-        r = cg_get_path(SYSTEMD_CGROUP_CONTROLLER, crt->cgroup_path, "memory.events", &events);
+        r = cg_get_path(crt->cgroup_path, "memory.events", &events);
         if (r < 0)
                 return log_oom();
 
@@ -2103,7 +2103,7 @@ static int unit_update_cgroup(
         CGroupRuntime *crt = ASSERT_PTR(unit_get_cgroup_runtime(u));
 
         uint64_t cgroup_id = 0;
-        r = cg_get_path(SYSTEMD_CGROUP_CONTROLLER, crt->cgroup_path, NULL, &cgroup_full_path);
+        r = cg_get_path(crt->cgroup_path, /* suffix = */ NULL, &cgroup_full_path);
         if (r == 0) {
                 r = cg_path_get_cgroupid(cgroup_full_path, &cgroup_id);
                 if (r < 0)
@@ -3769,7 +3769,7 @@ static int unit_get_io_accounting_raw(
         if (!FLAGS_SET(crt->cgroup_realized_mask, CGROUP_MASK_IO))
                 return -ENODATA;
 
-        r = cg_get_path("io", crt->cgroup_path, "io.stat", &path);
+        r = cg_get_path(crt->cgroup_path, "io.stat", &path);
         if (r < 0)
                 return r;
 
@@ -4107,7 +4107,7 @@ int unit_cgroup_freezer_action(Unit *u, FreezerAction action) {
                         assert_not_reached();
         }
 
-        r = cg_get_path(SYSTEMD_CGROUP_CONTROLLER, crt->cgroup_path, "cgroup.freeze", &path);
+        r = cg_get_path(crt->cgroup_path, "cgroup.freeze", &path);
         if (r < 0)
                 return r;
 
index 88178a82f96c6f09c98e4ae6ae6073dee87a179a..97a7107384146c91c78fe4e6e58c323c28c61f23 100644 (file)
@@ -5579,7 +5579,7 @@ int exec_invoke(
 
                 if (is_pressure_supported() > 0) {
                         if (cgroup_context_want_memory_pressure(cgroup_context)) {
-                                r = cg_get_path("memory", params->cgroup_path, "memory.pressure", &memory_pressure_path);
+                                r = cg_get_path(params->cgroup_path, "memory.pressure", &memory_pressure_path);
                                 if (r < 0) {
                                         *exit_status = EXIT_MEMORY;
                                         return log_oom();
@@ -5597,7 +5597,7 @@ int exec_invoke(
                                  * memory_pressure_path != NULL in the conditional below. */
                                 if (memory_pressure_path && needs_sandboxing && exec_needs_cgroup_namespace(context)) {
                                         memory_pressure_path = mfree(memory_pressure_path);
-                                        r = cg_get_path("memory", "/", "memory.pressure", &memory_pressure_path);
+                                        r = cg_get_path("/", "memory.pressure", &memory_pressure_path);
                                         if (r < 0) {
                                                 *exit_status = EXIT_MEMORY;
                                                 return log_oom();
index 0eb854f4abdb98b158ec09a1c626ab2651f80615..5cbe076506ebc8252914ab839c89d109a334ff18 100644 (file)
@@ -616,7 +616,7 @@ static int machine_watch_cgroup(Machine *m) {
                 return 0;
 
         _cleanup_free_ char *p = NULL;
-        r = cg_get_path(SYSTEMD_CGROUP_CONTROLLER, m->cgroup, "cgroup.events", &p);
+        r = cg_get_path(m->cgroup, "cgroup.events", &p);
         if (r < 0)
                 return log_error_errno(r, "Failed to get cgroup path for cgroup '%s': %m", m->cgroup);
 
index caa55186efcc1e1de0f0a7d09edec4f8b2d0c02c..db99b7d846327e419d1541b57c51766f0d672562 100644 (file)
@@ -113,7 +113,7 @@ int create_subcgroup(
                         return log_error_errno(r, "Failed to add cgroup %s to userns: %m", payload);
         } else {
                 _cleanup_free_ char *fs = NULL;
-                r = cg_get_path(SYSTEMD_CGROUP_CONTROLLER, payload, NULL, &fs);
+                r = cg_get_path(payload, /* suffix = */ NULL, &fs);
                 if (r < 0)
                         return log_error_errno(r, "Failed to get file system path for container cgroup: %m");
 
index fcd00f8c16b30c288605cfc6d000fcddda3959ea..e463ce01f2c2d3c1aa36a064a9a8aab0883017d3 100644 (file)
@@ -240,7 +240,7 @@ int oomd_cgroup_kill(const char *path, bool recurse, bool dry_run) {
         if (dry_run) {
                 _cleanup_free_ char *cg_path = NULL;
 
-                r = cg_get_path(SYSTEMD_CGROUP_CONTROLLER, path, NULL, &cg_path);
+                r = cg_get_path(path, /* suffix = */ NULL, &cg_path);
                 if (r < 0)
                         return r;
 
@@ -418,7 +418,7 @@ int oomd_cgroup_context_acquire(const char *path, OomdCGroupContext **ret) {
         is_root = empty_or_root(path);
         ctx->preference = MANAGED_OOM_PREFERENCE_NONE;
 
-        r = cg_get_path(SYSTEMD_CGROUP_CONTROLLER, path, "memory.pressure", &p);
+        r = cg_get_path(path, "memory.pressure", &p);
         if (r < 0)
                 return log_debug_errno(r, "Error getting cgroup memory pressure path from %s: %m", path);
 
index e0fddd7973cec3ff85b9fcf242a22512ea9e4201..a33480587101e9d226591201269119f1ccac052f 100644 (file)
@@ -78,7 +78,7 @@ int cg_trim(const char *path, bool delete_root) {
         _cleanup_free_ char *fs = NULL;
         int r;
 
-        r = cg_get_path(SYSTEMD_CGROUP_CONTROLLER, path, NULL, &fs);
+        r = cg_get_path(path, /* suffix = */ NULL, &fs);
         if (r < 0)
                 return r;
 
@@ -115,7 +115,7 @@ int cg_create(const char *path) {
         _cleanup_free_ char *fs = NULL;
         int r;
 
-        r = cg_get_path(SYSTEMD_CGROUP_CONTROLLER, path, NULL, &fs);
+        r = cg_get_path(path, /* suffix = */ NULL, &fs);
         if (r < 0)
                 return r;
 
@@ -140,7 +140,7 @@ int cg_attach(const char *path, pid_t pid) {
         assert(path);
         assert(pid >= 0);
 
-        r = cg_get_path(SYSTEMD_CGROUP_CONTROLLER, path, "cgroup.procs", &fs);
+        r = cg_get_path(path, "cgroup.procs", &fs);
         if (r < 0)
                 return r;
 
@@ -216,7 +216,7 @@ int cg_set_access(
                 return 0;
 
         /* Configure access to the cgroup itself */
-        r = cg_get_path(SYSTEMD_CGROUP_CONTROLLER, path, NULL, &fs);
+        r = cg_get_path(path, /* suffix = */ NULL, &fs);
         if (r < 0)
                 return r;
 
@@ -289,7 +289,7 @@ int cg_set_access_recursive(
         if (!uid_is_valid(uid) && !gid_is_valid(gid))
                 return 0;
 
-        r = cg_get_path(SYSTEMD_CGROUP_CONTROLLER, path, NULL, &fs);
+        r = cg_get_path(path, /* suffix = */ NULL, &fs);
         if (r < 0)
                 return r;
 
@@ -396,7 +396,7 @@ int cg_enable(
                 return 0;
         }
 
-        r = cg_get_path(SYSTEMD_CGROUP_CONTROLLER, p, "cgroup.subtree_control", &fs);
+        r = cg_get_path(p, "cgroup.subtree_control", &fs);
         if (r < 0)
                 return r;
 
index 6a591d7192adf3d69361fbe19bf2561b43ddc74b..47ffaf725f24290f2ba268ea69dc41611ab7841a 100644 (file)
@@ -313,7 +313,7 @@ int show_cgroup(const char *path,
 
         assert(path);
 
-        r = cg_get_path(SYSTEMD_CGROUP_CONTROLLER, path, NULL, &p);
+        r = cg_get_path(path, /* suffix = */ NULL, &p);
         if (r < 0)
                 return r;
 
index a998c049cceddcfa8c74b285451f4526e36d878f..186f0b6c4a0701ea0b0f9e6e2d80ae0bfa14d121 100644 (file)
@@ -1110,7 +1110,7 @@ static int condition_test_psi(Condition *c, char **env) {
                         free_and_replace(slice_path, slice_joined);
                 }
 
-                r = cg_get_path(SYSTEMD_CGROUP_CONTROLLER, slice_path, controller, &pressure_path);
+                r = cg_get_path(slice_path, controller, &pressure_path);
                 if (r < 0)
                         return log_debug_errno(r, "Error getting cgroup pressure path from %s: %m", slice_path);
 
index fb8155c45db8eb2d812976feb2ad3cbb7ab04916..78e748765544ddde04aff33879ffc8a794be624a 100644 (file)
@@ -275,7 +275,7 @@ int main(int argc, char *argv[]) {
         if (r < 0)
                 return log_tests_skipped_errno(r, "Failed to prepare cgroup subtree");
 
-        r = cg_get_path(SYSTEMD_CGROUP_CONTROLLER, cgroup, NULL, &controller_path);
+        r = cg_get_path(cgroup, /* suffix = */ NULL, &controller_path);
         ASSERT_OK(r);
 
         _cleanup_(bpf_program_freep) BPFProgram *prog = NULL;
index 5c162bbbf3a138ed244c5554eb6d2e20bf2c2beb..ae33e1fcd13cb68fa231a8b1f6f68553940245bf 100644 (file)
@@ -54,7 +54,7 @@ TEST(cg_create) {
         ASSERT_TRUE(path_equal(path, test_d));
         free(path);
 
-        ASSERT_OK_ZERO(cg_get_path(SYSTEMD_CGROUP_CONTROLLER, test_d, NULL, &path));
+        ASSERT_OK_ZERO(cg_get_path(test_d, /* suffix = */ NULL, &path));
         log_debug("test_d: %s", path);
         ASSERT_TRUE(path_equal(path, strjoina("/sys/fs/cgroup", test_d)));
         free(path);