Skip to content

Commit febeb6d

Browse files
anakryikoAlexei Starovoitov
authored andcommitted
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: bf99c93 ("libbpf: Add BPF ring buffer support") Signed-off-by: Andrii Nakryiko <andriin@fb.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Acked-by: Song Liu <songliubraving@fb.com> Link: https://lore.kernel.org/bpf/20200601202601.2139477-1-andriin@fb.com
1 parent 958a3f2 commit febeb6d

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎tools/lib/bpf/ringbuf.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
*
55
* Copyright (C) 2020 Facebook, Inc.
66
*/
7+
#ifndef _GNU_SOURCE
8+
#define _GNU_SOURCE
9+
#endif
710
#include <stdlib.h>
811
#include <stdio.h>
912
#include <errno.h>

0 commit comments

Comments
 (0)