diff options
| author | Sebastien Bacher <seb128@ubuntu.com> | 2021-02-25 11:36:45 +0100 |
|---|---|---|
| committer | Sebastien Bacher <seb128@ubuntu.com> | 2021-02-25 11:36:45 +0100 |
| commit | d92aa7f298fe84d4cf686c5ad64b73438e00d377 (patch) | |
| tree | 2f1f4c7b48cff9e63b0d0e3669bada3d9aeda72e /shared/systemd/src/basic/cgroup-util.h | |
| parent | a82e048a943092315a32d745c99e0f5635e29134 (diff) | |
| parent | 3a56bce6c0ea7ba0fe269520547740783b342e0d (diff) | |
Merge branch 'upstream/latest' of https://salsa.debian.org/utopia-team/network-manager into upstream/latest
Diffstat (limited to 'shared/systemd/src/basic/cgroup-util.h')
| -rw-r--r-- | shared/systemd/src/basic/cgroup-util.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/shared/systemd/src/basic/cgroup-util.h b/shared/systemd/src/basic/cgroup-util.h index 2b88571b..bdc0d0d0 100644 --- a/shared/systemd/src/basic/cgroup-util.h +++ b/shared/systemd/src/basic/cgroup-util.h @@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: LGPL-2.1+ */ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ #pragma once #include <dirent.h> @@ -208,6 +208,9 @@ static inline int cg_get_keyed_attribute_graceful( int cg_get_attribute_as_uint64(const char *controller, const char *path, const char *attribute, uint64_t *ret); +/* Does a parse_boolean() on the attribute contents and sets ret accordingly */ +int cg_get_attribute_as_bool(const char *controller, const char *path, const char *attribute, bool *ret); + int cg_set_access(const char *controller, const char *path, uid_t uid, gid_t gid); int cg_set_xattr(const char *controller, const char *path, const char *name, const void *value, size_t size, int flags); @@ -275,3 +278,13 @@ CGroupController cgroup_controller_from_string(const char *s) _pure_; bool is_cgroup_fs(const struct statfs *s); bool fd_is_cgroup_fs(int fd); + +typedef enum ManagedOOMMode { + MANAGED_OOM_AUTO, + MANAGED_OOM_KILL, + _MANAGED_OOM_MODE_MAX, + _MANAGED_OOM_MODE_INVALID = -1, +} ManagedOOMMode; + +const char* managed_oom_mode_to_string(ManagedOOMMode m) _const_; +ManagedOOMMode managed_oom_mode_from_string(const char *s) _pure_; |