summaryrefslogtreecommitdiff
path: root/tools/lib/bpf/str_error.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/lib/bpf/str_error.c')
-rw-r--r--tools/lib/bpf/str_error.c18
1 files changed, 0 insertions, 18 deletions
diff --git a/tools/lib/bpf/str_error.c b/tools/lib/bpf/str_error.c
deleted file mode 100644
index 00e48ac5b806..000000000000
--- a/tools/lib/bpf/str_error.c
+++ /dev/null
@@ -1,18 +0,0 @@
-// SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause)
-#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 *libbpf_strerror_r(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;
-}