aboutsummaryrefslogtreecommitdiffstats
path: root/tools/bpf/bpftool/iter.c
diff options
context:
space:
mode:
authorQuentin Monnet <[email protected]>2022-10-25 15:03:22 +0000
committerAlexei Starovoitov <[email protected]>2022-10-25 17:11:56 +0000
commitb3d84af7cdfc079ef86d94f7cf125821559925fa (patch)
treeccf59a53c1caa6f861363f00caa9c06eb88a1f2f /tools/bpf/bpftool/iter.c
parentselftests/bpf: Add write to hashmap to array_map iter test (diff)
downloadkernel-b3d84af7cdfc079ef86d94f7cf125821559925fa.tar.gz
kernel-b3d84af7cdfc079ef86d94f7cf125821559925fa.zip
bpftool: Define _GNU_SOURCE only once
_GNU_SOURCE is defined in several source files for bpftool, but only one of them takes the precaution of checking whether the value is already defined. Add #ifndef for other occurrences too. This is in preparation for the support of disassembling JIT-ed programs with LLVM, with $(llvm-config --cflags) passing -D_GNU_SOURCE as a compilation argument. Signed-off-by: Quentin Monnet <[email protected]> Tested-by: Niklas Söderlund <[email protected]> Acked-by: Song Liu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexei Starovoitov <[email protected]>
Diffstat (limited to 'tools/bpf/bpftool/iter.c')
-rw-r--r--tools/bpf/bpftool/iter.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/bpf/bpftool/iter.c b/tools/bpf/bpftool/iter.c
index f88fdc820d23..a3e6b167153d 100644
--- a/tools/bpf/bpftool/iter.c
+++ b/tools/bpf/bpftool/iter.c
@@ -1,7 +1,9 @@
// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
// Copyright (C) 2020 Facebook
+#ifndef _GNU_SOURCE
#define _GNU_SOURCE
+#endif
#include <unistd.h>
#include <linux/err.h>
#include <bpf/libbpf.h>