summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2018-10-11 18:31:11 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2018-10-17 14:40:44 +0200
commitc8884aceefc85245b9bdfb626e2daf27521259bd (patch)
tree40399ba6a0042b8018bf02a34cb5f87ba85f0834
parentmain: bump fs.nr_open + fs.max-file to their largest possible values (diff)
downloadsystemd-c8884aceefc85245b9bdfb626e2daf27521259bd.tar.xz
systemd-c8884aceefc85245b9bdfb626e2daf27521259bd.zip
main: introduce a define HIGH_RLIMIT_MEMLOCK similar to HIGH_RLIMIT_NOFILE
Diffstat (limited to '')
-rw-r--r--src/basic/def.h1
-rw-r--r--src/core/main.c2
2 files changed, 2 insertions, 1 deletions
diff --git a/src/basic/def.h b/src/basic/def.h
index 05e352bc4f..65ad659999 100644
--- a/src/basic/def.h
+++ b/src/basic/def.h
@@ -77,3 +77,4 @@
#define LONG_LINE_MAX (1U*1024U*1024U)
#define HIGH_RLIMIT_NOFILE (256*1024)
+#define HIGH_RLIMIT_MEMLOCK (1024ULL*1024ULL*64ULL)
diff --git a/src/core/main.c b/src/core/main.c
index 6b910fc91a..1a95486c03 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -1304,7 +1304,7 @@ static int bump_rlimit_memlock(struct rlimit *saved_rlimit) {
if (getrlimit(RLIMIT_MEMLOCK, saved_rlimit) < 0)
return log_warning_errno(errno, "Reading RLIMIT_MEMLOCK failed, ignoring: %m");
- r = setrlimit_closest(RLIMIT_MEMLOCK, &RLIMIT_MAKE_CONST(1024ULL*1024ULL*64ULL));
+ r = setrlimit_closest(RLIMIT_MEMLOCK, &RLIMIT_MAKE_CONST(HIGH_RLIMIT_MEMLOCK));
if (r < 0)
return log_warning_errno(r, "Setting RLIMIT_MEMLOCK failed, ignoring: %m");