aboutsummaryrefslogtreecommitdiffstats
path: root/tools/bpf/bpftool/common.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/bpf/bpftool/common.c')
-rw-r--r--tools/bpf/bpftool/common.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/bpf/bpftool/common.c b/tools/bpf/bpftool/common.c
index 25af85304ebe..1149565be4b1 100644
--- a/tools/bpf/bpftool/common.c
+++ b/tools/bpf/bpftool/common.c
@@ -46,6 +46,7 @@
46#include <linux/magic.h> 46#include <linux/magic.h>
47#include <net/if.h> 47#include <net/if.h>
48#include <sys/mount.h> 48#include <sys/mount.h>
49#include <sys/resource.h>
49#include <sys/stat.h> 50#include <sys/stat.h>
50#include <sys/types.h> 51#include <sys/types.h>
51#include <sys/vfs.h> 52#include <sys/vfs.h>
@@ -99,6 +100,13 @@ static bool is_bpffs(char *path)
99 return (unsigned long)st_fs.f_type == BPF_FS_MAGIC; 100 return (unsigned long)st_fs.f_type == BPF_FS_MAGIC;
100} 101}
101 102
103void set_max_rlimit(void)
104{
105 struct rlimit rinf = { RLIM_INFINITY, RLIM_INFINITY };
106
107 setrlimit(RLIMIT_MEMLOCK, &rinf);
108}
109
102static int mnt_bpffs(const char *target, char *buff, size_t bufflen) 110static int mnt_bpffs(const char *target, char *buff, size_t bufflen)
103{ 111{
104 bool bind_done = false; 112 bool bind_done = false;