strerror_r.cxx 343 B

1234567891011121314
  1. // Check for strerror_r.
  2. // It can be either the POSIX version (which returns int) or the GNU version
  3. // (which returns char *).
  4. #include <cstring>
  5. #include <type_traits>
  6. int main()
  7. {
  8. char buffer[200];
  9. auto res{strerror_r(1, buffer, 200)};
  10. // Sidestep type differences. We don't really care what the value is.
  11. return not not res;
  12. }