mirror of
https://github.com/torvalds/linux.git
synced 2026-11-29 01:43:18 +00:00
Add function errstr(int err) that allows converting numeric error codes into string representations. Signed-off-by: Mykyta Yatsenko <[email protected]> Signed-off-by: Andrii Nakryiko <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
17 lines
479 B
C
17 lines
479 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 **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);
|
|
#endif /* __LIBBPF_STR_ERROR_H */
|