summaryrefslogtreecommitdiffstats
path: root/samples/bpf/syscall_nrs.c
diff options
context:
space:
mode:
authorIvan Khoronzhuk <ivan.khoronzhuk@linaro.org>2019-08-15 14:13:56 +0200
committerDaniel Borkmann <daniel@iogearbox.net>2019-08-21 14:31:38 +0200
commitbb4b5c08a8e0f854a313184498b22fa37dd087db (patch)
treee61180ca51498f2d106aa490fddd31f9af22f273 /samples/bpf/syscall_nrs.c
parentxdp: xdp_umem: replace kmap on vmap for umem map (diff)
downloadlinux-bb4b5c08a8e0f854a313184498b22fa37dd087db.tar.xz
linux-bb4b5c08a8e0f854a313184498b22fa37dd087db.zip
samples: bpf: syscall_nrs: use mmap2 if defined
For arm32 xdp sockets mmap2 is preferred, so use it if it's defined. Declaration of __NR_mmap can be skipped and it breaks build. Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org> Acked-by: Jonathan Lemon <jonathan.lemon@gmail.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'samples/bpf/syscall_nrs.c')
-rw-r--r--samples/bpf/syscall_nrs.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/samples/bpf/syscall_nrs.c b/samples/bpf/syscall_nrs.c
index 516e255cbe8f..88f940052450 100644
--- a/samples/bpf/syscall_nrs.c
+++ b/samples/bpf/syscall_nrs.c
@@ -9,5 +9,11 @@ void syscall_defines(void)
COMMENT("Linux system call numbers.");
SYSNR(__NR_write);
SYSNR(__NR_read);
+#ifdef __NR_mmap2
+ SYSNR(__NR_mmap2);
+#endif
+#ifdef __NR_mmap
SYSNR(__NR_mmap);
+#endif
+
}