diff options
author | Daniel Borkmann <daniel@iogearbox.net> | 2018-02-27 00:34:32 +0300 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2018-02-27 07:11:23 +0300 |
commit | fe8d662aef26394388bfcd3b96ce123b6d33044b (patch) | |
tree | c236669015f5b2b435d0283f3d6f62f30cdc552c /tools/testing/selftests/bpf/test_dev_cgroup.c | |
parent | 3808b51911fe1a2bf8d6f4f2836d4c51aa29a6fd (diff) | |
download | linux-fe8d662aef26394388bfcd3b96ce123b6d33044b.tar.xz |
bpf: unify rlimit handling in selftests
Unify memlock handling into bpf_rlimit.h and replace all occurences
in BPF kselftests with it.
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/testing/selftests/bpf/test_dev_cgroup.c')
-rw-r--r-- | tools/testing/selftests/bpf/test_dev_cgroup.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/tools/testing/selftests/bpf/test_dev_cgroup.c b/tools/testing/selftests/bpf/test_dev_cgroup.c index 3489cc283433..9c8b50bac7e0 100644 --- a/tools/testing/selftests/bpf/test_dev_cgroup.c +++ b/tools/testing/selftests/bpf/test_dev_cgroup.c @@ -11,13 +11,13 @@ #include <errno.h> #include <assert.h> #include <sys/time.h> -#include <sys/resource.h> #include <linux/bpf.h> #include <bpf/bpf.h> #include <bpf/libbpf.h> #include "cgroup_helpers.h" +#include "bpf_rlimit.h" #define DEV_CGROUP_PROG "./dev_cgroup.o" @@ -25,15 +25,11 @@ int main(int argc, char **argv) { - struct rlimit limit = { RLIM_INFINITY, RLIM_INFINITY }; struct bpf_object *obj; int error = EXIT_FAILURE; int prog_fd, cgroup_fd; __u32 prog_cnt; - if (setrlimit(RLIMIT_MEMLOCK, &limit) < 0) - perror("Unable to lift memlock rlimit"); - if (bpf_prog_load(DEV_CGROUP_PROG, BPF_PROG_TYPE_CGROUP_DEVICE, &obj, &prog_fd)) { printf("Failed to load DEV_CGROUP program\n"); |