In the source standard, strerror_r() is implemented as a macro causing it to behave as described in ISO POSIX (2003), and is equivalent to the function __xpg_strerror_r(). If the macro is undefined, strerror_r() from the binary standard is used, with differences as described here.
The strerror_r() function shall return a pointer to the string corresponding to the error number errnum. The returned pointer may point within the buffer buf (at most buflen bytes).
On success, strerror_r() shall return a pointer
to the generated message string (determined by the setting of the
LC_MESSAGES category in the current locale).
Otherwise, strerror_r() shall return the string
corresponding to "Unknown error".