chiark / gitweb /
systemctl: fix corrupted output of units
[elogind.git] / src / cgroup-util.h
1 /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
2
3 #ifndef foocgrouputilhfoo
4 #define foocgrouputilhfoo
5
6 /***
7   This file is part of systemd.
8
9   Copyright 2010 Lennart Poettering
10
11   systemd is free software; you can redistribute it and/or modify it
12   under the terms of the GNU General Public License as published by
13   the Free Software Foundation; either version 2 of the License, or
14   (at your option) any later version.
15
16   systemd is distributed in the hope that it will be useful, but
17   WITHOUT ANY WARRANTY; without even the implied warranty of
18   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19   General Public License for more details.
20
21   You should have received a copy of the GNU General Public License
22   along with systemd; If not, see <http://www.gnu.org/licenses/>.
23 ***/
24
25 #include <sys/types.h>
26 #include <stdio.h>
27 #include <dirent.h>
28
29 #include "set.h"
30 #include "def.h"
31
32 int cg_enumerate_processes(const char *controller, const char *path, FILE **_f);
33 int cg_enumerate_tasks(const char *controller, const char *path, FILE **_f);
34 int cg_read_pid(FILE *f, pid_t *_pid);
35
36 int cg_enumerate_subgroups(const char *controller, const char *path, DIR **_d);
37 int cg_read_subgroup(DIR *d, char **fn);
38
39 int cg_kill(const char *controller, const char *path, int sig, bool sigcont, bool ignore_self, Set *s);
40 int cg_kill_recursive(const char *controller, const char *path, int sig, bool sigcont, bool ignore_self, bool remove, Set *s);
41 int cg_kill_recursive_and_wait(const char *controller, const char *path, bool remove);
42
43 int cg_migrate(const char *controller, const char *from, const char *to, bool ignore_self);
44 int cg_migrate_recursive(const char *controller, const char *from, const char *to, bool ignore_self, bool remove);
45
46 int cg_split_spec(const char *spec, char **controller, char **path);
47 int cg_join_spec(const char *controller, const char *path, char **spec);
48 int cg_fix_path(const char *path, char **result);
49
50 int cg_get_path(const char *controller, const char *path, const char *suffix, char **fs);
51 int cg_get_by_pid(const char *controller, pid_t pid, char **path);
52
53 int cg_trim(const char *controller, const char *path, bool delete_root);
54
55 int cg_rmdir(const char *controller, const char *path, bool honour_sticky);
56 int cg_delete(const char *controller, const char *path);
57
58 int cg_create(const char *controller, const char *path);
59 int cg_attach(const char *controller, const char *path, pid_t pid);
60 int cg_create_and_attach(const char *controller, const char *path, pid_t pid);
61
62 int cg_set_group_access(const char *controller, const char *path, mode_t mode, uid_t uid, gid_t gid);
63 int cg_set_task_access(const char *controller, const char *path, mode_t mode, uid_t uid, gid_t gid);
64
65 int cg_install_release_agent(const char *controller, const char *agent);
66
67 int cg_is_empty(const char *controller, const char *path, bool ignore_self);
68 int cg_is_empty_recursive(const char *controller, const char *path, bool ignore_self);
69
70 int cg_get_user_path(char **path);
71
72 #endif