X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;ds=sidebyside;f=src%2Fshared%2Fcgroup-util.h;h=06c6bfb2e32b17e66eebb19167f628cfa93d68c4;hb=46ba8aae2b82bc5c87ba347e6bf914ecd5e9d51e;hp=37e4255a9c4dc1b47470057a64a986d886a7160a;hpb=77d47be64f8b0497c44a4288f2531fc1056624ae;p=elogind.git diff --git a/src/shared/cgroup-util.h b/src/shared/cgroup-util.h index 37e4255a9..06c6bfb2e 100644 --- a/src/shared/cgroup-util.h +++ b/src/shared/cgroup-util.h @@ -1,7 +1,6 @@ /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ -#ifndef foocgrouputilhfoo -#define foocgrouputilhfoo +#pragma once /*** This file is part of systemd. @@ -9,16 +8,16 @@ 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 + under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2.1 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. + Lesser General Public License for more details. - You should have received a copy of the GNU General Public License + You should have received a copy of the GNU Lesser General Public License along with systemd; If not, see . ***/ @@ -40,14 +39,15 @@ int cg_kill(const char *controller, const char *path, int sig, bool sigcont, boo int cg_kill_recursive(const char *controller, const char *path, int sig, bool sigcont, bool ignore_self, bool remove, Set *s); int cg_kill_recursive_and_wait(const char *controller, const char *path, bool remove); -int cg_migrate(const char *controller, const char *from, const char *to, bool ignore_self); -int cg_migrate_recursive(const char *controller, const char *from, const char *to, bool ignore_self, bool remove); +int cg_migrate(const char *cfrom, const char *pfrom, const char *cto, const char *pto, bool ignore_self); +int cg_migrate_recursive(const char *cfrom, const char *pfrom, const char *cto, const char *pto, bool ignore_self, bool remove); int cg_split_spec(const char *spec, char **controller, char **path); int cg_join_spec(const char *controller, const char *path, char **spec); int cg_fix_path(const char *path, char **result); int cg_get_path(const char *controller, const char *path, const char *suffix, char **fs); +int cg_get_path_and_check(const char *controller, const char *path, const char *suffix, char **fs); int cg_get_by_pid(const char *controller, pid_t pid, char **path); int cg_trim(const char *controller, const char *path, bool delete_root); @@ -65,8 +65,16 @@ int cg_set_task_access(const char *controller, const char *path, mode_t mode, ui int cg_install_release_agent(const char *controller, const char *agent); int cg_is_empty(const char *controller, const char *path, bool ignore_self); +int cg_is_empty_by_spec(const char *spec, bool ignore_self); int cg_is_empty_recursive(const char *controller, const char *path, bool ignore_self); int cg_get_user_path(char **path); +int cg_pid_get_cgroup(pid_t pid, char **root, char **cgroup); +int cg_pid_get_unit(pid_t pid, char **unit); +int cg_pid_get_user_unit(pid_t pid, char **unit); -#endif +int cgroup_to_unit(char *cgroup, char **unit); + +char **cg_shorten_controllers(char **controllers); + +int cg_controller_from_attr(const char *attr, char **controller);