From: Andrii Nakryiko Date: Mon, 1 Jun 2020 20:26:01 +0000 (-0700) Subject: libbpf: Add _GNU_SOURCE for reallocarray to ringbuf.c X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=febeb6dff7beafcaf89521f6c8ff7b0adac08d54;p=linux.git libbpf: Add _GNU_SOURCE for reallocarray to ringbuf.c On systems with recent enough glibc, reallocarray compat won't kick in, so reallocarray() itself has to come from stdlib.h include. But _GNU_SOURCE is necessary to enable it. So add it. Fixes: bf99c936f947 ("libbpf: Add BPF ring buffer support") Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Acked-by: Song Liu Link: https://lore.kernel.org/bpf/20200601202601.2139477-1-andriin@fb.com --- diff --git a/tools/lib/bpf/ringbuf.c b/tools/lib/bpf/ringbuf.c index bc10fa1d43c7b..4fc6c6cbb4eb9 100644 --- a/tools/lib/bpf/ringbuf.c +++ b/tools/lib/bpf/ringbuf.c @@ -4,6 +4,9 @@ * * Copyright (C) 2020 Facebook, Inc. */ +#ifndef _GNU_SOURCE +#define _GNU_SOURCE +#endif #include #include #include