summaryrefslogtreecommitdiff
path: root/src/shared
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/cgroup-util.c17
-rw-r--r--src/shared/cgroup-util.h1
-rw-r--r--src/shared/unit-name.c3
-rw-r--r--src/shared/unit-name.h1
4 files changed, 21 insertions, 1 deletions
diff --git a/src/shared/cgroup-util.c b/src/shared/cgroup-util.c
index 5816b7d4d6..0e5da23ecd 100644
--- a/src/shared/cgroup-util.c
+++ b/src/shared/cgroup-util.c
@@ -1679,6 +1679,23 @@ int cg_attach_with_mask(CGroupControllerMask mask, const char *path, pid_t pid)
return r;
}
+int cg_attach_many_with_mask(CGroupControllerMask mask, const char *path, Set* pids) {
+ Iterator i;
+ void *pidp;
+ int r = 0;
+
+ SET_FOREACH(pidp, pids, i) {
+ pid_t pid = PTR_TO_LONG(pidp);
+ int k;
+
+ k = cg_attach_with_mask(mask, path, pid);
+ if (k < 0)
+ r = k;
+ }
+
+ return r;
+}
+
int cg_migrate_with_mask(CGroupControllerMask mask, const char *from, const char *to) {
CGroupControllerMask bit = 1;
const char *n;
diff --git a/src/shared/cgroup-util.h b/src/shared/cgroup-util.h
index 9883d941c2..c781aabb22 100644
--- a/src/shared/cgroup-util.h
+++ b/src/shared/cgroup-util.h
@@ -127,6 +127,7 @@ int cg_slice_to_path(const char *unit, char **ret);
int cg_create_with_mask(CGroupControllerMask mask, const char *path);
int cg_attach_with_mask(CGroupControllerMask mask, const char *path, pid_t pid);
+int cg_attach_many_with_mask(CGroupControllerMask mask, const char *path, Set* pids);
int cg_migrate_with_mask(CGroupControllerMask mask, const char *from, const char *to);
int cg_trim_with_mask(CGroupControllerMask mask, const char *path, bool delete_root);
diff --git a/src/shared/unit-name.c b/src/shared/unit-name.c
index bf1ab794a8..f2c30a6e4f 100644
--- a/src/shared/unit-name.c
+++ b/src/shared/unit-name.c
@@ -44,7 +44,8 @@ static const char* const unit_type_table[_UNIT_TYPE_MAX] = {
[UNIT_TIMER] = "timer",
[UNIT_SWAP] = "swap",
[UNIT_PATH] = "path",
- [UNIT_SLICE] = "slice"
+ [UNIT_SLICE] = "slice",
+ [UNIT_SCOPE] = "scope"
};
DEFINE_STRING_TABLE_LOOKUP(unit_type, UnitType);
diff --git a/src/shared/unit-name.h b/src/shared/unit-name.h
index 922d75232d..88f2b83443 100644
--- a/src/shared/unit-name.h
+++ b/src/shared/unit-name.h
@@ -42,6 +42,7 @@ enum UnitType {
UNIT_SWAP,
UNIT_PATH,
UNIT_SLICE,
+ UNIT_SCOPE,
_UNIT_TYPE_MAX,
_UNIT_TYPE_INVALID = -1
};