Make cgroup_build_tasks_procs_path() available to
libcgroup.la library users (i.e. the libcgroup tools).

This change will be used in the next commit so that
cgsnapshot can properly read the tasks/procs file.

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

diff --git a/src/api.c b/src/api.c
index c1ffdf57a7be..11855be23314 100644
--- a/src/api.c
+++ b/src/api.c
@@ -1501,18 +1501,9 @@ char *cg_build_path(const char *name, char *path, const 
char *type)
        return path;
 }
 
-/**
- * Build the path to the tasks or cgroup.procs file
- *
- * @param path Output variable that will contain the path.  Must be
-              of size FILENAME_MAX or larger
- * @param path_sz Size of the path string
- * @param cg_name Cgroup name
- * @param ctrl_name Controller name
- */
-STATIC int cgroup_build_tasks_procs_path(char * const path,
-                               size_t path_sz, const char * const cg_name,
-                               const char * const ctrl_name)
+int cgroup_build_tasks_procs_path(char * const path,
+                                 size_t path_sz, const char * const cg_name,
+                                 const char * const ctrl_name)
 {
        enum cg_version_t version;
        int err = ECGOTHER;
diff --git a/src/libcgroup-internal.h b/src/libcgroup-internal.h
index 5dcf7ee09711..800227c0c86c 100644
--- a/src/libcgroup-internal.h
+++ b/src/libcgroup-internal.h
@@ -307,6 +307,20 @@ int cg_chmod_path(const char *path, mode_t mode, int 
owner_is_umask);
  */
 int cgroup_get_controller_version(const char * const controller,
                enum cg_version_t * const version);
+
+/**
+ * Build the path to the tasks or cgroup.procs file
+ *
+ * @param path Output variable that will contain the path.  Must be
+              of size FILENAME_MAX or larger
+ * @param path_sz Size of the path string
+ * @param cg_name Cgroup name
+ * @param ctrl_name Controller name
+ */
+int cgroup_build_tasks_procs_path(char * const path,
+                                 size_t path_sz, const char * const cg_name,
+                                 const char * const 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
@@ -343,10 +357,6 @@ int cgroup_chown_chmod_tasks(const char * const cg_path,
 int cgroupv2_subtree_control(const char *path, const char *ctrl_name,
                             bool enable);
 
-int cgroup_build_tasks_procs_path(char * const path,
-                                 size_t path_sz, const char * const cg_name,
-                                 const char * const ctrl_name);
-
 int cgroupv2_get_subtree_control(const char *path,
                                 const char *ctrl_name,
                                 bool * const enabled);
diff --git a/src/libcgroup.map b/src/libcgroup.map
index 8fe199058e82..8b7fd6ad13c8 100644
--- a/src/libcgroup.map
+++ b/src/libcgroup.map
@@ -129,3 +129,7 @@ CGROUP_0.41 {
 CGROUP_0.42 {
        cgroup_add_all_controllers;
 } CGROUP_0.41;
+
+CGROUP_0.43 {
+       cgroup_build_tasks_procs_path;
+} CGROUP_0.42;
-- 
2.25.4



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

Reply via email to