35 #if defined HAVE__SYS_ERRLIST_AND__SYS_NERR || \ 36 defined HAVE_SYS_ERRLIST_AND_SYS_NERR 50 #ifdef HAVE_STRERRORDESC_NP 53 const char* desc = strerrordesc_np(e);
57 s +=
"Unknown error ";
60 #elif defined HAVE__SYS_ERRLIST_AND__SYS_NERR 62 if (e >= 0 && e < _sys_nerr && _sys_errlist[e]) {
65 s +=
"Unknown error ";
68 #elif defined HAVE_SYS_ERRLIST_AND_SYS_NERR 70 if (e >= 0 && e < sys_nerr && sys_errlist[e]) {
73 s +=
"Unknown error ";
76 #elif HAVE_DECL_STRERROR_R 101 # ifdef STRERROR_R_CHAR_P 103 s += strerror_r(e, buf,
sizeof(buf));
108 int r = strerror_r(e, buf,
sizeof(buf));
112 s +=
"Unknown error ";
Convert errno value to std::string, thread-safe if possible.
Convert types to std::string.
void errno_to_string(int e, string &s)
string str(int value)
Convert int to std::string.