mirror of
https://github.com/netdata/libbpf.git
synced 2026-03-30 05:09:06 +08:00
libbpf: Introduce errstr() for stringifying errno
Add function errstr(int err) that allows converting numeric error codes into string representations. Signed-off-by: Mykyta Yatsenko <yatsenko@meta.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/bpf/20241111212919.368971-2-mykyta.yatsenko5@gmail.com
This commit is contained in:
committed by
Andrii Nakryiko
parent
c975e02612
commit
8232da46d6
@@ -6,4 +6,11 @@
|
||||
|
||||
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 */
|
||||
|
||||
Reference in New Issue
Block a user