cgfsng: cg_is_pure_unified()

parent 96e6f37f
...@@ -1344,19 +1344,20 @@ static bool cg_hybrid_init(void) ...@@ -1344,19 +1344,20 @@ static bool cg_hybrid_init(void)
return true; return true;
} }
static int cg_is_pure_unified(void) { static int cg_is_pure_unified(void)
{
int ret; int ret;
struct statfs fs; struct statfs fs;
ret = statfs("/sys/fs/cgroup", &fs); ret = statfs("/sys/fs/cgroup", &fs);
if (ret < 0) if (ret < 0)
return -ENOMEDIUM; return -ENOMEDIUM;
if (is_fs_type(&fs, CGROUP2_SUPER_MAGIC)) if (is_fs_type(&fs, CGROUP2_SUPER_MAGIC))
return CGROUP2_SUPER_MAGIC; return CGROUP2_SUPER_MAGIC;
return 0; return 0;
} }
/* Get current cgroup from /proc/self/cgroup for the cgroupfs v2 hierarchy. */ /* Get current cgroup from /proc/self/cgroup for the cgroupfs v2 hierarchy. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment