-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge tag 'perf-urgent-for-mingo-4.19-20180918' of git://git.kernel.o…
…rg/pub/scm/linux/kernel/git/acme/linux into perf/urgent Pull perf/urgent fixes from Arnaldo Carvalho de Melo: - Fix the build on !_GNU_SOURCE libc systems such as Alpine Linux/musl libc due to usage of strerror_r glibc variant on libbpf (Arnaldo Carvalho de Melo) - Fix out-of-tree asciidoctor man page generation (Ben Hutchings) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Ingo Molnar <mingo@kernel.org>
- Loading branch information
Showing
5 changed files
with
36 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
libbpf-y := libbpf.o bpf.o nlattr.o btf.o libbpf_errno.o | ||
libbpf-y := libbpf.o bpf.o nlattr.o btf.o libbpf_errno.o str_error.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// SPDX-License-Identifier: LGPL-2.1 | ||
#undef _GNU_SOURCE | ||
#include <string.h> | ||
#include <stdio.h> | ||
#include "str_error.h" | ||
|
||
/* | ||
* Wrapper to allow for building in non-GNU systems such as Alpine Linux's musl | ||
* libc, while checking strerror_r() return to avoid having to check this in | ||
* all places calling it. | ||
*/ | ||
char *str_error(int err, char *dst, int len) | ||
{ | ||
int ret = strerror_r(err, dst, len); | ||
if (ret) | ||
snprintf(dst, len, "ERROR: strerror_r(%d)=%d", err, ret); | ||
return dst; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// SPDX-License-Identifier: LGPL-2.1 | ||
#ifndef BPF_STR_ERROR | ||
#define BPF_STR_ERROR | ||
|
||
char *str_error(int err, char *dst, int len); | ||
#endif // BPF_STR_ERROR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters