diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2017-05-20 20:26:36 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@parabola.nu> | 2018-08-16 21:55:16 -0400 |
commit | 06b1ac9ca56e1a0dbe277cf6bfddb13bea046f60 (patch) | |
tree | 1deaa6d692343db13dc545c8dc4675650bf57a6f | |
parent | 3cd2603fad33043c17b499afb468acc4a5e5ea00 (diff) |
cgroup-util: Add cg_version() to get the raw CGroupUnified enum
-rw-r--r-- | src/basic/cgroup-util.c | 11 | ||||
-rw-r--r-- | src/basic/cgroup-util.h | 1 |
2 files changed, 12 insertions, 0 deletions
diff --git a/src/basic/cgroup-util.c b/src/basic/cgroup-util.c index 76aac86142..add784417b 100644 --- a/src/basic/cgroup-util.c +++ b/src/basic/cgroup-util.c @@ -2535,6 +2535,17 @@ int cg_unified_flush(void) { return cg_unified_update(); } +int cg_version(CGroupUnified *ver) { + int r; + + r = cg_unified_update(); + if (r < 0) + return r; + + *ver = unified_cache; + return 0; +} + int cg_enable_everywhere(CGroupMask supported, CGroupMask mask, const char *p) { _cleanup_fclose_ FILE *f = NULL; _cleanup_free_ char *fs = NULL; diff --git a/src/basic/cgroup-util.h b/src/basic/cgroup-util.h index c9e11f3b78..82999337db 100644 --- a/src/basic/cgroup-util.h +++ b/src/basic/cgroup-util.h @@ -232,6 +232,7 @@ int cg_all_unified(void); int cg_hybrid_unified(void); int cg_unified_controller(const char *controller); int cg_unified_flush(void); +int cg_version(CGroupUnified *ver); bool cg_is_unified_wanted(void); bool cg_is_legacy_wanted(void); |