trinity.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Check for bpf_attr map_flags.
@ 2016-11-12  0:55 Vinson Lee
  0 siblings, 0 replies; only message in thread
From: Vinson Lee @ 2016-11-12  0:55 UTC (permalink / raw)
  To: trinity

map_flags is not available until Linux 4.6.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
---
 configure | 28 +++++++++++++++++++++++++++-
 1 file changed, 27 insertions(+), 1 deletion(-)

diff --git a/configure b/configure
index ca37e4efa27b..18d9df73985f 100755
--- a/configure
+++ b/configure
@@ -222,6 +222,33 @@ else
 fi
 
 #############################################################################################
+# is /usr/include/linux/bpf.h new enough to feature bpf
+#
+echo -n "[*] Checking if bpf_attr can use map_flags.. "
+rm -f "$TMP" || exit 1
+
+cat >"$TMP.c" << EOF
+#include <stdio.h>
+#include <linux/bpf.h>
+
+void main()
+{
+	union bpf_attr attr = {
+		.map_flags = 0,
+	};
+}
+EOF
+
+${CC} ${CFLAGS} "$TMP.c" -o "$TMP" &>"$TMP.log"
+if [ ! -x "$TMP" ]; then
+	echo $RED "[NO]" $COL_RESET
+	MISSING_DEFS=1
+else
+	echo $GREEN "[YES]" $COL_RESET
+	echo "#define USE_BPF 1" >> $CONFIGH
+fi
+
+#############################################################################################
 
 check_header linux/caif/caif_socket.h USE_CAIF
 check_header linux/if_alg.h USE_IF_ALG
@@ -239,7 +266,6 @@ check_header execinfo.h USE_BACKTRACE
 check_header netatalk/at.h USE_APPLETALK
 check_header netrom/netrom.h USE_NETROM
 check_header netrose/rose.h USE_ROSE
-check_header linux/bpf.h USE_BPF
 
 rm -f "$TMP" "$TMP.log" "$TMP.c"
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2016-11-12  0:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-12  0:55 [PATCH] Check for bpf_attr map_flags Vinson Lee

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).