From 702498a1426bc95b6f49f9c5fba616110cbd3947 Mon Sep 17 00:00:00 2001 From: Mickaël Salaün Date: Fri, 10 Feb 2017 00:21:44 +0100 Subject: bpf: Remove bpf_sys.h from selftests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add require dependency headers. Signed-off-by: Mickaël Salaün Cc: Alexei Starovoitov Cc: Daniel Borkmann Cc: Shuah Khan Signed-off-by: David S. Miller --- tools/lib/bpf/bpf.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tools/lib') diff --git a/tools/lib/bpf/bpf.c b/tools/lib/bpf/bpf.c index f8a2b7fa7741..50e04cc5dddd 100644 --- a/tools/lib/bpf/bpf.c +++ b/tools/lib/bpf/bpf.c @@ -50,7 +50,13 @@ static __u64 ptr_to_u64(const void *ptr) static int sys_bpf(enum bpf_cmd cmd, union bpf_attr *attr, unsigned int size) { +#ifdef __NR_bpf return syscall(__NR_bpf, cmd, attr, size); +#else + fprintf(stderr, "No bpf syscall, kernel headers too old?\n"); + errno = ENOSYS; + return -1; +#endif } int bpf_create_map(enum bpf_map_type map_type, int key_size, -- cgit v1.2.3-59-g8ed1b