summaryrefslogtreecommitdiff
path: root/tools/lib/bpf/str_error.h
diff options
context:
space:
mode:
authorIan Rogers <irogers@google.com>2025-03-21 01:24:39 +0300
committerAndrii Nakryiko <andrii@kernel.org>2025-03-21 23:44:54 +0300
commit307ef667e94530c2f2f77797bfe9ea85c22bec7d (patch)
tree24324339cfcd3f0b078631b35d3a98d97b5735a5 /tools/lib/bpf/str_error.h
parent51d65049cd7e22a4d9ab8f2acb018a147f7f5146 (diff)
downloadlinux-307ef667e94530c2f2f77797bfe9ea85c22bec7d.tar.xz
libbpf: Add namespace for errstr making it libbpf_errstr
When statically linking symbols can be replaced with those from other statically linked libraries depending on the link order and the hoped for "multiple definition" error may not appear. To avoid conflicts it is good practice to namespace symbols, this change renames errstr to libbpf_errstr. To avoid churn a #define is used to turn use of errstr(err) to libbpf_errstr(err). Fixes: 1633a83bf993 ("libbpf: Introduce errstr() for stringifying errno") Signed-off-by: Ian Rogers <irogers@google.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/bpf/20250320222439.1350187-1-irogers@google.com
Diffstat (limited to 'tools/lib/bpf/str_error.h')
-rw-r--r--tools/lib/bpf/str_error.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/lib/bpf/str_error.h b/tools/lib/bpf/str_error.h
index 66ffebde0684..53e7fbffc13e 100644
--- a/tools/lib/bpf/str_error.h
+++ b/tools/lib/bpf/str_error.h
@@ -7,10 +7,13 @@
char *libbpf_strerror_r(int err, char *dst, int len);
/**
- * @brief **errstr()** returns string corresponding to numeric errno
+ * @brief **libbpf_errstr()** returns string corresponding to numeric errno
* @param err negative numeric errno
* @return pointer to string representation of the errno, that is invalidated
* upon the next call.
*/
-const char *errstr(int err);
+const char *libbpf_errstr(int err);
+
+#define errstr(err) libbpf_errstr(err)
+
#endif /* __LIBBPF_STR_ERROR_H */