This source file includes following definitions.
- rlimit__bump_memlock
1
2
3 #include "util/debug.h"
4 #include "util/rlimit.h"
5 #include <sys/time.h>
6 #include <sys/resource.h>
7
8
9
10
11
12
13 void rlimit__bump_memlock(void)
14 {
15 struct rlimit rlim;
16
17 if (getrlimit(RLIMIT_MEMLOCK, &rlim) == 0) {
18 rlim.rlim_cur *= 4;
19 rlim.rlim_max *= 4;
20
21 if (setrlimit(RLIMIT_MEMLOCK, &rlim) < 0) {
22 rlim.rlim_cur /= 2;
23 rlim.rlim_max /= 2;
24
25 if (setrlimit(RLIMIT_MEMLOCK, &rlim) < 0)
26 pr_debug("Couldn't bump rlimit(MEMLOCK), failures may take place when creating BPF maps, etc\n");
27 }
28 }
29 }