Remove the static qualifier from cg_build_path_locked().  As part
of the cgget refactor, cgget will utilize this function.

Signed-off-by: Tom Hromatka <tom.hroma...@oracle.com>
---
 src/api.c                |  4 ++--
 src/libcgroup-internal.h | 14 ++++++++++++++
 src/libcgroup.map        |  1 +
 3 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/src/api.c b/src/api.c
index 11855be23314..8853e5439f0d 100644
--- a/src/api.c
+++ b/src/api.c
@@ -1460,8 +1460,8 @@ static char *cg_concat_path(const char *pref, const char 
*suf, char *path)
 
 /* Call with cg_mount_table_lock taken */
 /* path value have to have size at least FILENAME_MAX */
-static char *cg_build_path_locked(const char *name, char *path,
-                                               const char *type)
+char *cg_build_path_locked(const char *name, char *path,
+                          const char *type)
 {
        int i;
        for (i = 0; cg_mount_table[i].name[0] != '\0'; i++) {
diff --git a/src/libcgroup-internal.h b/src/libcgroup-internal.h
index 800227c0c86c..c152b6872c23 100644
--- a/src/libcgroup-internal.h
+++ b/src/libcgroup-internal.h
@@ -321,6 +321,20 @@ int cgroup_build_tasks_procs_path(char * const path,
                                  size_t path_sz, const char * const cg_name,
                                  const char * const ctrl_name);
 
+/**
+ * Build the full path to the controller/setting
+ *
+ * @param setting Cgroup virtual filename/setting (optional)
+ * @param path Output variable to contain the concatenated path
+ * @param controller Cgroup controller name
+ *
+ * @return If successful, a valid pointer to the concatenated path
+ *
+ * @note The cg_mount_table_lock must be held prior to calling this function
+ */
+char *cg_build_path_locked(const char *setting, char *path,
+                          const char *controller);
+
 /**
  * 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 8b7fd6ad13c8..fbb4530a6a04 100644
--- a/src/libcgroup.map
+++ b/src/libcgroup.map
@@ -132,4 +132,5 @@ CGROUP_0.42 {
 
 CGROUP_0.43 {
        cgroup_build_tasks_procs_path;
+       cg_build_path_locked;
 } CGROUP_0.42;
-- 
2.26.2



_______________________________________________
Libcg-devel mailing list
Libcg-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libcg-devel

Reply via email to