cgutil: export more functions to initctl

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2021-03-19 09:32:36 +01:00
parent fcb8ec9967
commit 728db73b09
2 changed files with 12 additions and 5 deletions
+3 -3
View File
@@ -60,7 +60,7 @@ struct cg dummy; /* empty result "NULL" */
struct cg *list;
static char *pid_cmdline(int pid, char *buf, size_t len)
char *pid_cmdline(int pid, char *buf, size_t len)
{
size_t i, sz;
char *ptr;
@@ -94,7 +94,7 @@ static char *pid_cmdline(int pid, char *buf, size_t len)
return buf;
}
static char *pid_comm(int pid, char *buf, size_t len)
char *pid_comm(int pid, char *buf, size_t len)
{
FILE *fp;
@@ -264,7 +264,7 @@ static int cgroup_filter(const struct dirent *entry)
return 1;
}
static int cgroup_tree(char *path, char *pfx, int top)
int cgroup_tree(char *path, char *pfx, int top)
{
struct dirent **namelist = NULL;
char s[32], r[32], l[32];
+9 -2
View File
@@ -24,8 +24,15 @@
#ifndef FINIT_CGUTIL_H_
#define FINIT_CGUTIL_H_
int show_cgroup (char *arg);
int show_cgtop (char *arg);
#include <stdlib.h>
char *pid_cmdline (int pid, char *buf, size_t len);
char *pid_comm (int pid, char *buf, size_t len);
int cgroup_tree (char *path, char *pfx, int top);
int show_cgroup (char *arg);
int show_cgtop (char *arg);
#endif /* FINIT_CGUTIL_H_ */