]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
api.c: Expose cgroup_test_subsys_mounted() to users of libcgroup.la
authorTom Hromatka <tom.hromatka@oracle.com>
Wed, 10 Feb 2021 17:21:23 +0000 (17:21 +0000)
committerTom Hromatka <tom.hromatka@oracle.com>
Mon, 1 Mar 2021 17:32:52 +0000 (10:32 -0700)
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 <tom.hromatka@oracle.com>
src/api.c
src/libcgroup-internal.h
src/libcgroup.map

index bdb5b21da1df946f3b9871ee3513369bed034789..0e9f98578693c38baed6eab0cadb5d85b7fd7f7e 100644 (file)
--- 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;
 
index eef54442674b28e977c900f52456ce907c187249..c2f75f55602105510cb69b33823ff038da1323dc 100644 (file)
@@ -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
index f7cc710a27a30b3ed4c38186998a0b831099d4a7..6eb22f0527010c27939546a095cc046e61212b8d 100644 (file)
@@ -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;