diff options
-rwxr-xr-x | net/test/bpf.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/test/bpf.py b/net/test/bpf.py index 5062e31..9e8f6c8 100755 --- a/net/test/bpf.py +++ b/net/test/bpf.py @@ -22,6 +22,7 @@ import cstruct import net_test import socket import platform +import resource # __NR_bpf syscall numbers for various architectures. # NOTE: If python inherited COMPAT_UTS_MACHINE, uname's 'machine' field will @@ -178,6 +179,8 @@ BpfInsn = cstruct.Struct("bpf_insn", "=BBhi", "code dst_src_reg off imm") libc = ctypes.CDLL(ctypes.util.find_library("c"), use_errno=True) HAVE_EBPF_SUPPORT = net_test.LINUX_VERSION >= (4, 4, 0) +# set memlock resource 1 GiB +resource.setrlimit(resource.RLIMIT_MEMLOCK, (1073741824, 1073741824)) # BPF program syscalls def BpfSyscall(op, attr): |