]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
libcpu: Fix build of bpf_disasm.c for kernels < 3.20.
authorMark Wielaard <mjw@redhat.com>
Mon, 5 Sep 2016 09:15:50 +0000 (11:15 +0200)
committerMark Wielaard <mjw@redhat.com>
Mon, 5 Sep 2016 09:15:50 +0000 (11:15 +0200)
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>
libcpu/ChangeLog
libcpu/bpf_disasm.c

index 9f3566c0233beca401df76d700105a01848abb11..9cce4e7261dabf9126b1e08ba31af77235ba4fae 100644 (file)
@@ -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
index 153dba9d2c36eda7f8824aefdf6ad8193d214d79..e4bbae4a8379d0f16ffe32986b36c0fe6bc4d5f5 100644 (file)
 #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",