Supersedes #35308 (cherry-picked one commit and replaced the rest)
(I left a few comments that's folded by GitHub. Please make sure to
check them too.)
if (!pidref_is_set(pidref))
return -ESRCH;
+ if (pidref_is_remote(pidref))
+ return -EREMOTE;
+ // XXX: Ideally we'd use pidfd_get_cgroupid() + cg_path_from_cgroupid() here, to extract this
+ // bit of information from pidfd directly. However, the latter requires privilege and it's
+ // not entirely clear how to handle cgroups from outer namespace.
+
r = cg_pid_get_path(controller, pidref->pid, &path);
if (r < 0)
return r;