Let's set libbpf 1.0 API mode explicitly, then we can get rid of the included bpf_rlimit.h. This patch also removes the useless sys/resource.h.
Signed-off-by: Yafang Shao laoar.shao@gmail.com --- tools/testing/selftests/bpf/test_sockmap.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/bpf/test_sockmap.c b/tools/testing/selftests/bpf/test_sockmap.c index dfb4f5c0fcb9..0fbaccdc8861 100644 --- a/tools/testing/selftests/bpf/test_sockmap.c +++ b/tools/testing/selftests/bpf/test_sockmap.c @@ -18,7 +18,6 @@ #include <sched.h>
#include <sys/time.h> -#include <sys/resource.h> #include <sys/types.h> #include <sys/sendfile.h>
@@ -37,7 +36,6 @@ #include <bpf/libbpf.h>
#include "bpf_util.h" -#include "bpf_rlimit.h" #include "cgroup_helpers.h"
int running; @@ -2017,6 +2015,9 @@ int main(int argc, char **argv) cg_created = 1; }
+ /* Use libbpf 1.0 API mode */ + libbpf_set_strict_mode(LIBBPF_STRICT_ALL); + if (test == SELFTESTS) { err = test_selftest(cg_fd, &options); goto out;