diff options
author | Mark Wielaard <mjw@redhat.com> | 2016-09-05 11:15:50 +0200 |
---|---|---|
committer | Mark Wielaard <mjw@redhat.com> | 2016-09-05 11:15:50 +0200 |
commit | 4f7b5ba9624489b5a2f714569c29ef865d4dcd6f (patch) | |
tree | b6addabae98a27b009c1540987c66f4645cdbeeb | |
parent | 16bf45fa4de189693a3c2e0a5ed675dad7243e0b (diff) | |
download | elfutils-4f7b5ba9624489b5a2f714569c29ef865d4dcd6f.tar.gz |
libcpu: Fix build of bpf_disasm.c for kernels < 3.20.
Before linux 3.20 the BPF_PSEUDO_MAP_FD constant wasn't defined.
Reported-by: Julian Ospald <hasufell@posteo.de>
Signed-off-by: Mark Wielaard <mjw@redhat.com>
-rw-r--r-- | libcpu/ChangeLog | 4 | ||||
-rw-r--r-- | libcpu/bpf_disasm.c | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/libcpu/ChangeLog b/libcpu/ChangeLog index 9f3566c0..9cce4e72 100644 --- a/libcpu/ChangeLog +++ b/libcpu/ChangeLog @@ -1,3 +1,7 @@ +2016-09-05 Mark Wielaard <mjw@redhat.com> + + * bpf_disasm.c: Define BPF_PSEUDO_MAP_FD if undefined. + 2016-08-10 Richard Henderson <rth@redhat.com> * bpf_disasm.c (bpf_disasm): Rearrange the printing of instructions diff --git a/libcpu/bpf_disasm.c b/libcpu/bpf_disasm.c index 153dba9d..e4bbae4a 100644 --- a/libcpu/bpf_disasm.c +++ b/libcpu/bpf_disasm.c @@ -40,6 +40,10 @@ #include "../libelf/common.h" #include "../libebl/libeblP.h" +/* BPF_PSEUDO_MAP_FD was only introduced in linux 3.20. */ +#ifndef BPF_PSEUDO_MAP_FD + #define BPF_PSEUDO_MAP_FD 1 +#endif static const char class_string[8][8] = { [BPF_LD] = "ld", |