mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00

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: 1633a83bf9
("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
19 lines
534 B
C
19 lines
534 B
C
/* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */
|
|
#ifndef __LIBBPF_STR_ERROR_H
|
|
#define __LIBBPF_STR_ERROR_H
|
|
|
|
#define STRERR_BUFSIZE 128
|
|
|
|
char *libbpf_strerror_r(int err, char *dst, int len);
|
|
|
|
/**
|
|
* @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 *libbpf_errstr(int err);
|
|
|
|
#define errstr(err) libbpf_errstr(err)
|
|
|
|
#endif /* __LIBBPF_STR_ERROR_H */
|