libbpf: add _GNU_SOURCE for reallocarray to ringbuf.c
Subsystems (4)
PATCH 1/1 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 4cff2ba58bf1 ("libbpf: Add BPF ring buffer support")
Signed-off-by Andrii Nakryiko <[email protected]>
--- tools/lib/bpf/ringbuf.c | 3 +++ 1 file changed, 3 insertions(+)
tools/lib/bpf/ringbuf.c +3 -0
@@ -4,6 +4,9 @@* * Copyright (C) 2020 Facebook, Inc. */ +#ifndef _GNU_SOURCE +#define _GNU_SOURCE +#endif #include <stdlib.h> #include <stdio.h> #include <errno.h>
Signature · 1 line
2.24.1
Quoted 7 lines · Andrii Nakryiko
On systems with recent enough glibc, reallocarray compat won't kick in, so
reallocarray()itself has to come fromstdlib.hinclude. But_GNU_SOURCEis necessary to enable it. So add it.Fixes 4cff2ba58bf1 ("libbpf: Add BPF ring buffer support")Signed-off-by Andrii Nakryiko <[email protected]>
Acked-by Song Liu <[email protected]>
Alexei Starovoitov
AppliedQuoted 11 lines · Song Liu
Quoted 7 lines · Andrii Nakryiko
On systems with recent enough glibc, reallocarray compat won't kick in, so
reallocarray()itself has to come fromstdlib.hinclude. But_GNU_SOURCEis necessary to enable it. So add it.Fixes 4cff2ba58bf1 ("libbpf: Add BPF ring buffer support")Signed-off-by Andrii Nakryiko <[email protected]>Acked-by Song Liu <[email protected]>
Applied. Thanks