diff options
author | Lennart Poettering <lennart@poettering.net> | 2010-07-12 18:16:44 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2010-07-12 18:16:44 +0200 |
commit | 35d2e7ec19f8d3960a14dc04642060ccee3faa43 (patch) | |
tree | ec7b2c683f18f477a1dbc9af98b29273de17149e /src/cgroup-util.h | |
parent | dbd821acb4d91181b309860bb4d4b711b38da7b4 (diff) |
cgroup: reimplement the last bit of libcgroup functionality natively
Diffstat (limited to 'src/cgroup-util.h')
-rw-r--r-- | src/cgroup-util.h | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/src/cgroup-util.h b/src/cgroup-util.h index 716c635a95..8f96571243 100644 --- a/src/cgroup-util.h +++ b/src/cgroup-util.h @@ -24,29 +24,36 @@ #include <sys/types.h> #include <stdio.h> +#include <dirent.h> #include "set.h" #define SYSTEMD_CGROUP_CONTROLLER "name=systemd" -int cg_translate_error(int error, int _errno); - int cg_enumerate_processes(const char *controller, const char *path, FILE **_f); int cg_enumerate_tasks(const char *controller, const char *path, FILE **_f); - int cg_read_pid(FILE *f, pid_t *_pid); +int cg_enumerate_subgroups(const char *controller, const char *path, DIR **_d); +int cg_read_subgroup(DIR *d, char **fn); + int cg_kill(const char *controller, const char *path, int sig, bool ignore_self); -int cg_kill_recursive(const char *controller, const char *path, int sig, bool ignore_self); -int cg_kill_recursive_and_wait(const char *controller, const char *path); +int cg_kill_recursive(const char *controller, const char *path, int sig, bool ignore_self, bool remove); +int cg_kill_recursive_and_wait(const char *controller, const char *path, bool remove); int cg_migrate(const char *controller, const char *from, const char *to, bool ignore_self); -int cg_migrate_recursive(const char *controller, const char *from, const char *to, bool ignore_self); +int cg_migrate_recursive(const char *controller, const char *from, const char *to, bool ignore_self, bool remove); + +int cg_split_spec(const char *spec, char **controller, char **path); +int cg_join_spec(const char *controller, const char *path, char **spec); +int cg_fix_path(const char *path, char **result); int cg_get_path(const char *controller, const char *path, const char *suffix, char **fs); int cg_get_by_pid(const char *controller, pid_t pid, char **path); int cg_trim(const char *controller, const char *path, bool delete_root); + +int cg_rmdir(const char *controller, const char *path); int cg_delete(const char *controller, const char *path); int cg_create(const char *controller, const char *path); @@ -61,6 +68,4 @@ int cg_install_release_agent(const char *controller, const char *agent); int cg_is_empty(const char *controller, const char *path, bool ignore_self); int cg_is_empty_recursive(const char *controller, const char *path, bool ignore_self); -int cg_init(void); - #endif |