from cgroup.support.c
void sc_cgroup_create_and_join(const char *parent, const char *name, pid_t pid) { int parent_fd SC_CLEANUP(sc_cleanup_close) = -1; parent_fd = open(parent, O_PATH | O_DIRECTORY | O_NOFOLLOW | O_CLOEXEC); if (parent_fd < 0) { die("cannot open cgroup hierarchy %s", parent); }
https://github.com/snapcore/snapd/blob/36a8f0a616978fd1d2e0793c1ce4bae038e5b326/cmd/libsnap-confine-private/cgroup-support.c#L40
from cgroup.support.c
void sc_cgroup_ create_ and_join( const char *parent, const char *name, pid_t pid) { sc_cleanup_ close) = -1;
int parent_fd SC_CLEANUP(
parent_fd = open(parent, O_PATH | O_DIRECTORY | O_NOFOLLOW | O_CLOEXEC);
if (parent_fd < 0) {
die("cannot open cgroup hierarchy %s", parent);
}
https:/ /github. com/snapcore/ snapd/blob/ 36a8f0a616978fd 1d2e0793c1ce4ba e038e5b326/ cmd/libsnap- confine- private/ cgroup- support. c#L40