cgroup.h revision e7ab4d1ac9f8d99eecd5e2d22eb482a1fb0fbf23
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersen/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersen This file is part of systemd.
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersen Copyright 2013 Lennart Poettering
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersen systemd is free software; you can redistribute it and/or modify it
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersen under the terms of the GNU Lesser General Public License as published by
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersen the Free Software Foundation; either version 2.1 of the License, or
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersen (at your option) any later version.
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersen systemd is distributed in the hope that it will be useful, but
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersen WITHOUT ANY WARRANTY; without even the implied warranty of
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersen MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersen Lesser General Public License for more details.
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersen You should have received a copy of the GNU Lesser General Public License
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersen along with systemd; If not, see <http://www.gnu.org/licenses/>.
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersentypedef struct CGroupDeviceAllow CGroupDeviceAllow;
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersentypedef struct CGroupBlockIODeviceWeight CGroupBlockIODeviceWeight;
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersentypedef struct CGroupBlockIODeviceBandwidth CGroupBlockIODeviceBandwidth;
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersen /* When devices listed, will allow those, plus built-in ones,
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersen if none are listed will allow everything. */
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersen /* Everything forbidden, except built-in ones and listed ones. */
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersen /* Everythings forbidden, except for the listed devices */
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersen LIST_FIELDS(CGroupBlockIODeviceWeight, device_weights);
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersen LIST_FIELDS(CGroupBlockIODeviceBandwidth, device_bandwidths);
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersen LIST_HEAD(CGroupBlockIODeviceWeight, blockio_device_weights);
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersen LIST_HEAD(CGroupBlockIODeviceBandwidth, blockio_device_bandwidths);
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersenvoid cgroup_context_dump(CGroupContext *c, FILE* f, const char *prefix);
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersenvoid cgroup_context_apply(CGroupContext *c, CGroupMask mask, const char *path, ManagerState state);
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom GundersenCGroupMask cgroup_context_get_mask(CGroupContext *c);
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersenvoid cgroup_context_free_device_allow(CGroupContext *c, CGroupDeviceAllow *a);
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersenvoid cgroup_context_free_blockio_device_weight(CGroupContext *c, CGroupBlockIODeviceWeight *w);
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersenvoid cgroup_context_free_blockio_device_bandwidth(CGroupContext *c, CGroupBlockIODeviceBandwidth *b);
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersenvoid unit_update_cgroup_members_masks(Unit *u);
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersenint unit_set_cgroup_path(Unit *u, const char *path);
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersenvoid manager_shutdown_cgroup(Manager *m, bool delete);
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersenunsigned manager_dispatch_cgroup_queue(Manager *m);
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom GundersenUnit *manager_get_unit_by_cgroup(Manager *m, const char *cgroup);
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom GundersenUnit *manager_get_unit_by_pid_cgroup(Manager *m, pid_t pid);
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom GundersenUnit* manager_get_unit_by_pid(Manager *m, pid_t pid);
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersenint unit_get_memory_current(Unit *u, uint64_t *ret);
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersenint unit_get_tasks_current(Unit *u, uint64_t *ret);
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersenint manager_notify_cgroup_empty(Manager *m, const char *group);
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersenvoid unit_invalidate_cgroup(Unit *u, CGroupMask m);
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersenvoid manager_invalidate_startup_units(Manager *m);
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersenconst char* cgroup_device_policy_to_string(CGroupDevicePolicy i) _const_;