X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fbasic%2Fcgroup-util.c;h=a19995051198cc6706bc01c9569aa89ff71be3e2;hp=c98c1c4003dff4aa18c8d7419ef3f97d2e12ad80;hb=d72545b2a0c29e5844c508101cd4720c356193b4;hpb=84e95f5f10da05aced04f9785d3db729c29c45e3 diff --git a/src/basic/cgroup-util.c b/src/basic/cgroup-util.c index c98c1c400..a19995051 100644 --- a/src/basic/cgroup-util.c +++ b/src/basic/cgroup-util.c @@ -134,6 +134,22 @@ int cg_read_event(const char *controller, const char *path, const char *event, return -ENOENT; } +#if 0 /// UNNEEDED by elogind +bool cg_ns_supported(void) { + static thread_local int enabled = -1; + + if (enabled >= 0) + return enabled; + + if (access("/proc/self/ns/cgroup", F_OK) == 0) + enabled = 1; + else + enabled = 0; + + return enabled; +} +#endif //0 + int cg_enumerate_subgroups(const char *controller, const char *path, DIR **_d) { _cleanup_free_ char *fs = NULL; int r; @@ -376,7 +392,8 @@ int cg_migrate( log_debug_elogind("Migrating \"%s\"/\"%s\" to \"%s\"/\"%s\" (%s)", cfrom, pfrom, cto, pto, - ignore_self ? "ignoring self" : "watching self"); + (flags & CGROUP_IGNORE_SELF) + ? "ignoring self" : "watching self"); do { _cleanup_fclose_ FILE *f = NULL; pid_t pid = 0; @@ -1925,7 +1942,6 @@ int cg_set_attribute(const char *controller, const char *path, const char *attri return write_string_file(p, value, 0); } -#if 0 /// UNNEEDED by elogind int cg_get_attribute(const char *controller, const char *path, const char *attribute, char **ret) { _cleanup_free_ char *p = NULL; int r; @@ -1937,6 +1953,7 @@ int cg_get_attribute(const char *controller, const char *path, const char *attri return read_one_line_file(p, ret); } +#if 0 /// UNNEEDED by elogind int cg_create_everywhere(CGroupMask supported, CGroupMask mask, const char *path) { CGroupController c; int r, unified; @@ -2239,8 +2256,8 @@ int cg_unified(void) { #else /* elogind can not support the unified hierarchy as a controller, * so always assume a classical hierarchy. - * If, ond only *if*, someone really wants to substitute systemd-login - * in an environment managed by systemd with elogin, we might have to + * If, and only *if*, someone really wants to substitute systemd-login + * in an environment managed by systemd with elogind, we might have to * add such a support. */ if (F_TYPE_EQUAL(fs.f_type, TMPFS_MAGIC)) #endif // 0