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 <[email protected]> Signed-off-by: Alexei Starovoitov <[email protected]> Acked-by: Song Liu <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
1 parent 958a3f2 commit febeb6d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

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)