X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fcgroup.h;h=a6ac90fb094bfecd7a5d0ba12ad1831aea244d3e;hp=a7ca8abb063bcb6e35fd7081369babf48aa90f08;hb=d4a7e06dea271fb38bfbca0090654f54cfb37992;hpb=55096547212928b0ba83fca2595cae0d66d3c0b0 diff --git a/src/cgroup.h b/src/cgroup.h index a7ca8abb0..a6ac90fb0 100644 --- a/src/cgroup.h +++ b/src/cgroup.h @@ -1,4 +1,4 @@ -/*-*- Mode: C; c-basic-offset: 8 -*-*/ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ #ifndef foocgrouphfoo #define foocgrouphfoo @@ -26,8 +26,6 @@ typedef struct CGroupBonding CGroupBonding; #include "unit.h" -#define SYSTEMD_CGROUP_CONTROLLER "name=systemd" - /* Binds a cgroup to a name */ struct CGroupBonding { char *controller; @@ -41,11 +39,12 @@ struct CGroupBonding { /* For the Manager::cgroup_bondings hashmap */ LIST_FIELDS(CGroupBonding, by_path); - /* When shutting down, remove cgroup? */ - bool clean_up:1; + /* When shutting down, remove cgroup? Are our own tasks the + * only ones in this group?*/ + bool ours:1; - /* When our tasks are the only ones in this group */ - bool only_us:1; + /* If we cannot create this group, or add a process to it, is this fatal? */ + bool essential:1; /* This cgroup is realized */ bool realized:1; @@ -60,8 +59,8 @@ void cgroup_bonding_free_list(CGroupBonding *first); int cgroup_bonding_install(CGroupBonding *b, pid_t pid); int cgroup_bonding_install_list(CGroupBonding *first, pid_t pid); -int cgroup_bonding_kill(CGroupBonding *b, int sig); -int cgroup_bonding_kill_list(CGroupBonding *first, int sig); +int cgroup_bonding_kill(CGroupBonding *b, int sig, bool sigcont, Set *s); +int cgroup_bonding_kill_list(CGroupBonding *first, int sig, bool sigcont, Set *s); void cgroup_bonding_trim(CGroupBonding *first, bool delete_root); void cgroup_bonding_trim_list(CGroupBonding *first, bool delete_root); @@ -73,10 +72,13 @@ CGroupBonding *cgroup_bonding_find_list(CGroupBonding *first, const char *contro char *cgroup_bonding_to_string(CGroupBonding *b); +pid_t cgroup_bonding_search_main_pid(CGroupBonding *b); +pid_t cgroup_bonding_search_main_pid_list(CGroupBonding *b); + #include "manager.h" int manager_setup_cgroup(Manager *m); -int manager_shutdown_cgroup(Manager *m); +void manager_shutdown_cgroup(Manager *m, bool delete); int cgroup_notify_empty(Manager *m, const char *group);