13 #ifndef __STOUT_OS_STRERROR_HPP__
14 #define __STOUT_OS_STRERROR_HPP__
34 #if !defined(__GLIBC__) || \
35 ((_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && \
36 !defined(_GNU_SOURCE))
39 char* buffer =
new char[
size];
42 if (::
strerror_r(errno_, buffer, size) == ERANGE) {
45 buffer =
new char[
size];
47 const std::string message = buffer;
67 #endif // __STOUT_OS_STRERROR_HPP__
std::string strerror(int errno_)
A thread-safe version of strerror.
Definition: strerror.hpp:30
Try< Bytes > size(const std::string &path, const FollowSymlink follow=FollowSymlink::FOLLOW_SYMLINK)
Definition: stat.hpp:100
auto strerror_r(int errnum, char *buffer, size_t length) ->
Definition: windows.hpp:348