Comment 4 for bug 1933128

Revision history for this message
Heather Lemon (hypothetical-lemon) wrote :

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