summaryrefslogtreecommitdiff
path: root/src/basic/util.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-10-19 19:02:47 +0200
committerLennart Poettering <lennart@poettering.net>2015-10-19 19:02:47 +0200
commitaa486a72be9903daf870b050616769d1b4e78a33 (patch)
tree6561f4ea355882a41dbc4267c652a27dd85c5586 /src/basic/util.c
parent9badb85de0821c98c7adf5dc90b2ba590987dbb5 (diff)
parente9cc999a306a789049304997f855dec2eabe5579 (diff)
Merge pull request #1598 from evverx/run-oomscoreadjust
systemd-run can launch units with OOMScoreAdjust
Diffstat (limited to 'src/basic/util.c')
-rw-r--r--src/basic/util.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/basic/util.c b/src/basic/util.c
index 8b896a2df3..2565b0f547 100644
--- a/src/basic/util.c
+++ b/src/basic/util.c
@@ -29,6 +29,7 @@
#include <libintl.h>
#include <limits.h>
#include <linux/magic.h>
+#include <linux/oom.h>
#include <linux/sched.h>
#include <locale.h>
#include <netinet/ip.h>
@@ -6800,3 +6801,7 @@ bool fdname_is_valid(const char *s) {
return p - s < 256;
}
+
+bool oom_score_adjust_is_valid(int oa) {
+ return oa >= OOM_SCORE_ADJ_MIN && oa <= OOM_SCORE_ADJ_MAX;
+}