[PATCH 01/10] bpf samples: bpf: Fix tracex5_kern.c compiling error

From: Wang Nan
Date: Thu Dec 17 2015 - 00:23:48 EST


LLVM report compiling error:

/kpathsamples/bpf/tracex5_kern.c:33:15: error: use of undeclared identifier '__NR_getuid'; did you
mean '__NR_vgetcpu'?
if (sd.nr >= __NR_getuid && sd.nr <= __NR_getsid) {
^~~~~~~~~~~
__NR_vgetcpu
/kpath/arch/x86/include/uapi/asm/vsyscall.h:7:2: note: '__NR_vgetcpu' declared here
__NR_vgetcpu,

This patch fix it by adding asm/unistd.h to it.

Signed-off-by: Wang Nan <wangnan0@xxxxxxxxxx>
Cc: Alexei Starovoitov <ast@xxxxxxxxxxxx>
Cc: David S. Miller <davem@xxxxxxxxxxxxx>
---
samples/bpf/tracex5_kern.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/samples/bpf/tracex5_kern.c b/samples/bpf/tracex5_kern.c
index b3f4295..2964efd 100644
--- a/samples/bpf/tracex5_kern.c
+++ b/samples/bpf/tracex5_kern.c
@@ -8,6 +8,7 @@
#include <linux/version.h>
#include <uapi/linux/bpf.h>
#include <uapi/linux/seccomp.h>
+#include <asm/unistd.h>
#include "bpf_helpers.h"

#define PROG(F) SEC("kprobe/"__stringify(F)) int bpf_func_##F
--
1.8.3.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/