AC_CHECK_FUNCS(strncasecmp strcasecmp)
AC_CHECK_FUNCS(openlog syslog closelog)
+AC_FUNC_STRERROR_R
+
AC_CHECK_FUNCS(getpwnam_r)
AC_CHECK_FUNCS(getgrnam_r)
return (r);
}
-/* Don't use the return value of `strerror_r', because the GNU-people got
- * inventive there.. -octo */
+/* Even though Posix requires "strerror_r" to return an "int",
+ * some systems (e.g. the GNU libc) return a "char *" _and_
+ * ignore the second argument ... -tokkee */
char *sstrerror (int errnum, char *buf, size_t buflen)
{
buf[0] = '\0';
+#ifdef STRERROR_R_CHAR_P
+ buf = strerror_r (errnum, buf, buflen);
+#else
strerror_r (errnum, buf, buflen);
+#endif /* STRERROR_R_CHAR_P */
return (buf);
} /* char *sstrerror */