From: Tom Hromatka Date: Wed, 10 Feb 2021 17:21:23 +0000 (+0000) Subject: api.c: Expose cgroup_test_subsys_mounted() to users of libcgroup.la X-Git-Tag: v2.0.rc1~10^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=da36d96e95a34cfcfaad62ffc6ced6cf397f4555;p=thirdparty%2Flibcgroup.git api.c: Expose cgroup_test_subsys_mounted() to users of libcgroup.la Remove the static qualifier from cgroup_test_subsys_mounted(). As part of the cgget refactor, cgget will utilize this function. Signed-off-by: Tom Hromatka --- diff --git a/src/api.c b/src/api.c index bdb5b21d..0e9f9857 100644 --- a/src/api.c +++ b/src/api.c @@ -384,7 +384,7 @@ static char *cgroup_basename(const char *path) return base; } -static int cgroup_test_subsys_mounted(const char *name) +int cgroup_test_subsys_mounted(const char *name) { int i; diff --git a/src/libcgroup-internal.h b/src/libcgroup-internal.h index eef54442..c2f75f55 100644 --- a/src/libcgroup-internal.h +++ b/src/libcgroup-internal.h @@ -350,6 +350,14 @@ char *cg_build_path_locked(const char *setting, char *path, int cgroup_fill_cgc(struct dirent *ctrl_dir, struct cgroup *cgroup, struct cgroup_controller *cgc, int cg_index); +/** + * Given a controller name, test if it's mounted + * + * @param ctrl_name Controller name + * @return 1 if mounted, 0 if not mounted + */ +int cgroup_test_subsys_mounted(const char *ctrl_name); + /** * Functions that are defined as STATIC can be placed within the UNIT_TEST * ifdef. This will allow them to be included in the unit tests while diff --git a/src/libcgroup.map b/src/libcgroup.map index f7cc710a..6eb22f05 100644 --- a/src/libcgroup.map +++ b/src/libcgroup.map @@ -134,4 +134,5 @@ CGROUP_0.43 { cgroup_build_tasks_procs_path; cg_build_path_locked; cgroup_fill_cgc; + cgroup_test_subsys_mounted; } CGROUP_0.42;