]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
api.c: Export cgroup_build_tasks_procs_path()
authorTom Hromatka <tom.hromatka@oracle.com>
Thu, 17 Dec 2020 18:38:52 +0000 (11:38 -0700)
committerTom Hromatka <tom.hromatka@oracle.com>
Wed, 23 Dec 2020 15:13:26 +0000 (08:13 -0700)
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.hromatka@oracle.com>
Reviewed-by: Dhaval Giani <dhaval.giani@oracle.com>
src/api.c
src/libcgroup-internal.h
src/libcgroup.map

index c1ffdf57a7beb018d3a24cea14953fe002fe5357..11855be233146f3602101c223962236d6e2c2480 100644 (file)
--- 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;
index 5dcf7ee0971107e8d31859592a559b6ce5fc0e38..800227c0c86cdd1616e875d09651ffe66b01236c 100644 (file)
@@ -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);
index 8fe199058e82de1c4d4346fe25382741fd2c6cb4..8b7fd6ad13c8883a2ee31e467f4b88b71e8e4a8b 100644 (file)
@@ -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;