Lines Matching defs:cgroup

34 #include "cgroup-util.h"
67 r = cg_get_path(controller, path, "cgroup.procs", &fs);
82 /* Note that the cgroup.procs might contain duplicates! See
340 * exist in the root cgroup, we only check for
467 * /sys/fs/cgroup/ we want to mount it to. Effectively, this
488 t = strappend("/sys/fs/cgroup/", dn);
490 t = strjoin("/sys/fs/cgroup/", dn, "/", suffix, NULL);
492 t = strjoin("/sys/fs/cgroup/", dn, "/", path, NULL);
494 t = strjoin("/sys/fs/cgroup/", dn, "/", path, "/", suffix, NULL);
508 t = strdup("/sys/fs/cgroup");
510 t = strappend("/sys/fs/cgroup/", suffix);
512 t = strappend("/sys/fs/cgroup/", path);
514 t = strjoin("/sys/fs/cgroup/", path, "/", suffix, NULL);
597 cc = strjoina("/sys/fs/cgroup/", dn);
699 /* This does not remove the cgroup on failure */
711 r = cg_get_path_and_check(controller, path, "cgroup.procs", &fs);
790 r = cg_get_path(controller, path, "cgroup.procs", &fs);
805 * "cgroup.procs" */
835 fs = procfs_file_alloca(pid, "cgroup");
1001 /* The root cgroup is always populated */
1013 * via the "cgroup.populated" attribute. */
1015 r = cg_get_path(controller, path, "cgroup.populated", &populated);
1151 if (path_startswith(path, "/sys/fs/cgroup")) {
1191 int cg_shift_path(const char *cgroup, const char *root, const char **shifted) {
1196 assert(cgroup);
1210 p = path_startswith(cgroup, root);
1211 if (p && p > cgroup)
1214 *shifted = cgroup;
1219 int cg_pid_get_path_shifted(pid_t pid, const char *root, char **cgroup) {
1225 assert(cgroup);
1236 *cgroup = raw;
1245 *cgroup = n;
1251 int cg_path_decode_unit(const char *cgroup, char **unit){
1255 assert(cgroup);
1258 n = strcspn(cgroup, "/");
1262 c = strndupa(cgroup, n);
1341 _cleanup_free_ char *cgroup = NULL;
1346 r = cg_pid_get_path_shifted(pid, NULL, &cgroup);
1350 return cg_path_get_unit(cgroup, unit);
1462 _cleanup_free_ char *cgroup = NULL;
1467 r = cg_pid_get_path_shifted(pid, NULL, &cgroup);
1471 return cg_path_get_user_unit(cgroup, unit);
1488 _cleanup_free_ char *cgroup = NULL;
1493 r = cg_pid_get_path_shifted(pid, NULL, &cgroup);
1497 return cg_path_get_machine_name(cgroup, machine);
1536 _cleanup_free_ char *cgroup = NULL;
1539 r = cg_pid_get_path_shifted(pid, NULL, &cgroup);
1543 return cg_path_get_session(cgroup, session);
1572 _cleanup_free_ char *cgroup = NULL;
1575 r = cg_pid_get_path_shifted(pid, NULL, &cgroup);
1579 return cg_path_get_owner_uid(cgroup, uid);
1619 _cleanup_free_ char *cgroup = NULL;
1624 r = cg_pid_get_path_shifted(pid, NULL, &cgroup);
1628 return cg_path_get_slice(cgroup, slice);
1646 _cleanup_free_ char *cgroup = NULL;
1651 r = cg_pid_get_path_shifted(pid, NULL, &cgroup);
1655 return cg_path_get_user_slice(cgroup, slice);
1662 * as file names in the cgroup tree: any name which might
1664 * prefixed with a '_'. That way, when reading cgroup names it
1677 startswith(p, "cgroup."))
1844 /* This one will create a cgroup in our private tree, but also
1848 /* First create the cgroup in our own hierarchy. */
1991 /* Determines the mask of supported cgroup controllers. Only
2004 * cgroup attribute */
2010 r = cg_get_path(SYSTEMD_CGROUP_CONTROLLER, root, "cgroup.controllers", &path);
2122 * error when the cgroup hierarchies aren't mounted yet or we
2129 if (statfs("/sys/fs/cgroup/", &fs) < 0)
2162 r = cg_get_path(SYSTEMD_CGROUP_CONTROLLER, p, "cgroup.subtree_control", &fs);