diff options
author | Anthony G. Basile <blueness@gentoo.org> | 2013-06-04 20:50:18 -0400 |
---|---|---|
committer | Anthony G. Basile <blueness@gentoo.org> | 2013-06-04 20:50:24 -0400 |
commit | 58daf39a6c4002a9dd89690d88ce2ec41b2a7ea3 (patch) | |
tree | 1bc3760b30ce8753e5637d97dd8f0929da56c697 /src/libudev/cgroup-util.h | |
parent | 730b8403f9dc3e106379595e5667373f2eedb82e (diff) |
src/libudev/cgroup-util.{c,h}: bring in line with upstream
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Diffstat (limited to 'src/libudev/cgroup-util.h')
-rw-r--r-- | src/libudev/cgroup-util.h | 53 |
1 files changed, 16 insertions, 37 deletions
diff --git a/src/libudev/cgroup-util.h b/src/libudev/cgroup-util.h index 697669deba..11e7308e19 100644 --- a/src/libudev/cgroup-util.h +++ b/src/libudev/cgroup-util.h @@ -28,47 +28,26 @@ #include "set.h" #include "def.h" +/* + * General rules: + * + * We accept named hierarchies in the syntax "foo" and "name=foo". + * + * We expect that named hierarchies do not conflict in name with a + * kernel hierarchy, modulo the "name=" prefix. + * + * We always generate "normalized" controller names, i.e. without the + * "name=" prefix. + * + * We require absolute cgroup paths. When returning, we will always + * generate paths with multiple adjacent / removed. + */ + 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 sigcont, bool ignore_self, Set *s); -int cg_kill_recursive(const char *controller, const char *path, int sig, bool sigcont, bool ignore_self, bool remove, Set *s); -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, 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_path_and_check(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, bool honour_sticky); -int cg_delete(const char *controller, const char *path); - -int cg_create(const char *controller, const char *path); -int cg_attach(const char *controller, const char *path, pid_t pid); -int cg_create_and_attach(const char *controller, const char *path, pid_t pid); - -int cg_set_group_access(const char *controller, const char *path, mode_t mode, uid_t uid, gid_t gid); -int cg_set_task_access(const char *controller, const char *path, mode_t mode, uid_t uid, gid_t gid, int sticky); - -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_get_user_path(char **path); -int cg_pid_get_cgroup(pid_t pid, char **root, char **cgroup); -int cg_pid_get_unit(pid_t pid, char **unit); -char **cg_shorten_controllers(char **controllers); +bool cg_controller_is_valid(const char *p, bool allow_named); |