2010-08-17 05:33:07 +04:00
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
2010-03-31 18:29:55 +04:00
# ifndef foocgrouphfoo
# define foocgrouphfoo
/***
This file is part of systemd .
Copyright 2010 Lennart Poettering
systemd is free software ; you can redistribute it and / or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation ; either version 2 of the License , or
( at your option ) any later version .
systemd is distributed in the hope that it will be useful , but
WITHOUT ANY WARRANTY ; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the GNU
General Public License for more details .
You should have received a copy of the GNU General Public License
along with systemd ; If not , see < http : //www.gnu.org/licenses/>.
* * */
typedef struct CGroupBonding CGroupBonding ;
# include "unit.h"
/* Binds a cgroup to a name */
struct CGroupBonding {
char * controller ;
char * path ;
Unit * unit ;
2010-04-21 06:01:24 +04:00
/* For the Unit::cgroup_bondings list */
LIST_FIELDS ( CGroupBonding , by_unit ) ;
/* For the Manager::cgroup_bondings hashmap */
LIST_FIELDS ( CGroupBonding , by_path ) ;
2010-11-17 23:27:53 +03:00
/* When shutting down, remove cgroup? Are our own tasks the
* only ones in this group ? */
bool ours : 1 ;
2010-03-31 18:29:55 +04:00
2010-11-17 23:27:53 +03:00
/* If we cannot create this group, or add a process to it, is this fatal? */
bool essential : 1 ;
2010-06-22 01:27:18 +04:00
/* This cgroup is realized */
bool realized : 1 ;
2010-03-31 18:29:55 +04:00
} ;
int cgroup_bonding_realize ( CGroupBonding * b ) ;
int cgroup_bonding_realize_list ( CGroupBonding * first ) ;
2011-04-20 05:53:12 +04:00
void cgroup_bonding_free ( CGroupBonding * b , bool remove_or_trim ) ;
void cgroup_bonding_free_list ( CGroupBonding * first , bool remove_or_trim ) ;
2010-03-31 18:29:55 +04:00
int cgroup_bonding_install ( CGroupBonding * b , pid_t pid ) ;
int cgroup_bonding_install_list ( CGroupBonding * first , pid_t pid ) ;
2011-06-30 02:11:25 +04:00
int cgroup_bonding_set_group_access ( CGroupBonding * b , mode_t mode , uid_t uid , gid_t gid ) ;
int cgroup_bonding_set_group_access_list ( CGroupBonding * b , mode_t mode , uid_t uid , gid_t gid ) ;
int cgroup_bonding_set_task_access ( CGroupBonding * b , mode_t mode , uid_t uid , gid_t gid ) ;
int cgroup_bonding_set_task_access_list ( CGroupBonding * b , mode_t mode , uid_t uid , gid_t gid ) ;
2011-03-04 01:55:30 +03:00
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 ) ;
2010-03-31 18:29:55 +04:00
2010-07-10 19:34:42 +04:00
void cgroup_bonding_trim ( CGroupBonding * first , bool delete_root ) ;
void cgroup_bonding_trim_list ( CGroupBonding * first , bool delete_root ) ;
2010-03-31 18:29:55 +04:00
int cgroup_bonding_is_empty ( CGroupBonding * b ) ;
int cgroup_bonding_is_empty_list ( CGroupBonding * first ) ;
CGroupBonding * cgroup_bonding_find_list ( CGroupBonding * first , const char * controller ) ;
2010-04-18 05:04:54 +04:00
char * cgroup_bonding_to_string ( CGroupBonding * b ) ;
2010-10-27 05:16:49 +04:00
pid_t cgroup_bonding_search_main_pid ( CGroupBonding * b ) ;
pid_t cgroup_bonding_search_main_pid_list ( CGroupBonding * b ) ;
2010-03-31 18:29:55 +04:00
# include "manager.h"
int manager_setup_cgroup ( Manager * m ) ;
2010-07-11 02:50:49 +04:00
void manager_shutdown_cgroup ( Manager * m , bool delete ) ;
2010-03-31 18:29:55 +04:00
int cgroup_notify_empty ( Manager * m , const char * group ) ;
2010-06-16 07:10:31 +04:00
Unit * cgroup_unit_by_pid ( Manager * m , pid_t pid ) ;
2010-03-31 18:29:55 +04:00
# endif