34#if defined(HAVE_STRERROR_R) || HAVE_DECL_STRERROR_S
35 const int MaxErrStrLen = 2000;
36 char buffer[MaxErrStrLen];
42#if defined(__GLIBC__) && defined(_GNU_SOURCE)
45 str = strerror_r(errnum, buffer, MaxErrStrLen - 1);
47 strerror_r(errnum, buffer, MaxErrStrLen - 1);
50#elif HAVE_DECL_STRERROR_S
51 strerror_s(buffer, MaxErrStrLen - 1, errnum);
57 str = strerror(errnum);