1 /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
7 This file is part of systemd.
9 Copyright 2010 Lennart Poettering
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.
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.
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/>.
25 typedef struct CGroupBonding CGroupBonding;
29 /* Binds a cgroup to a name */
30 struct CGroupBonding {
36 /* For the Unit::cgroup_bondings list */
37 LIST_FIELDS(CGroupBonding, by_unit);
39 /* For the Manager::cgroup_bondings hashmap */
40 LIST_FIELDS(CGroupBonding, by_path);
42 /* When shutting down, remove cgroup? */
45 /* When our tasks are the only ones in this group */
48 /* This cgroup is realized */
52 int cgroup_bonding_realize(CGroupBonding *b);
53 int cgroup_bonding_realize_list(CGroupBonding *first);
55 void cgroup_bonding_free(CGroupBonding *b);
56 void cgroup_bonding_free_list(CGroupBonding *first);
58 int cgroup_bonding_install(CGroupBonding *b, pid_t pid);
59 int cgroup_bonding_install_list(CGroupBonding *first, pid_t pid);
61 int cgroup_bonding_kill(CGroupBonding *b, int sig);
62 int cgroup_bonding_kill_list(CGroupBonding *first, int sig);
64 void cgroup_bonding_trim(CGroupBonding *first, bool delete_root);
65 void cgroup_bonding_trim_list(CGroupBonding *first, bool delete_root);
67 int cgroup_bonding_is_empty(CGroupBonding *b);
68 int cgroup_bonding_is_empty_list(CGroupBonding *first);
70 CGroupBonding *cgroup_bonding_find_list(CGroupBonding *first, const char *controller);
72 char *cgroup_bonding_to_string(CGroupBonding *b);
76 int manager_setup_cgroup(Manager *m);
77 void manager_shutdown_cgroup(Manager *m, bool delete);
79 int cgroup_notify_empty(Manager *m, const char *group);
81 Unit* cgroup_unit_by_pid(Manager *m, pid_t pid);