]>
Commit | Line | Data |
---|---|---|
8e274523 LP |
1 | /*-*- Mode: C; c-basic-offset: 8 -*-*/ |
2 | ||
3 | #ifndef foocgrouphfoo | |
4 | #define foocgrouphfoo | |
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 | ||
8e274523 LP |
25 | typedef struct CGroupBonding CGroupBonding; |
26 | ||
27 | #include "unit.h" | |
28 | ||
55096547 LP |
29 | #define SYSTEMD_CGROUP_CONTROLLER "name=systemd" |
30 | ||
8e274523 LP |
31 | /* Binds a cgroup to a name */ |
32 | struct CGroupBonding { | |
33 | char *controller; | |
34 | char *path; | |
35 | ||
36 | Unit *unit; | |
37 | ||
9d58f1db LP |
38 | /* For the Unit::cgroup_bondings list */ |
39 | LIST_FIELDS(CGroupBonding, by_unit); | |
40 | ||
41 | /* For the Manager::cgroup_bondings hashmap */ | |
42 | LIST_FIELDS(CGroupBonding, by_path); | |
43 | ||
8e274523 LP |
44 | /* When shutting down, remove cgroup? */ |
45 | bool clean_up:1; | |
46 | ||
47 | /* When our tasks are the only ones in this group */ | |
48 | bool only_us:1; | |
8c6db833 LP |
49 | |
50 | /* This cgroup is realized */ | |
51 | bool realized:1; | |
8e274523 LP |
52 | }; |
53 | ||
54 | int cgroup_bonding_realize(CGroupBonding *b); | |
55 | int cgroup_bonding_realize_list(CGroupBonding *first); | |
56 | ||
57 | void cgroup_bonding_free(CGroupBonding *b); | |
58 | void cgroup_bonding_free_list(CGroupBonding *first); | |
59 | ||
60 | int cgroup_bonding_install(CGroupBonding *b, pid_t pid); | |
61 | int cgroup_bonding_install_list(CGroupBonding *first, pid_t pid); | |
62 | ||
63 | int cgroup_bonding_kill(CGroupBonding *b, int sig); | |
64 | int cgroup_bonding_kill_list(CGroupBonding *first, int sig); | |
65 | ||
fb385181 LP |
66 | void cgroup_bonding_trim(CGroupBonding *first, bool delete_root); |
67 | void cgroup_bonding_trim_list(CGroupBonding *first, bool delete_root); | |
68 | ||
8e274523 LP |
69 | int cgroup_bonding_is_empty(CGroupBonding *b); |
70 | int cgroup_bonding_is_empty_list(CGroupBonding *first); | |
71 | ||
72 | CGroupBonding *cgroup_bonding_find_list(CGroupBonding *first, const char *controller); | |
73 | ||
6dde1f33 LP |
74 | char *cgroup_bonding_to_string(CGroupBonding *b); |
75 | ||
8e274523 LP |
76 | #include "manager.h" |
77 | ||
78 | int manager_setup_cgroup(Manager *m); | |
8c6db833 | 79 | int manager_shutdown_cgroup(Manager *m); |
8e274523 LP |
80 | |
81 | int cgroup_notify_empty(Manager *m, const char *group); | |
82 | ||
8c47c732 LP |
83 | Unit* cgroup_unit_by_pid(Manager *m, pid_t pid); |
84 | ||
8e274523 | 85 | #endif |