4 dnl Determine whether the strerror_r implementation is one of
5 dnl the broken ones that returns `int' rather than `char*'.
6 dnl Actually, this tests only whether it returns a scalar
7 dnl or an array, but that should be enough.
8 dnl On at least DEC UNIX 4.0[A-D] and HP-UX B.10.20, strerror_r
9 dnl returns `int'. This is used by lib/error.c.
11 AC_DEFUN(jm_FUNC_STRERROR_R,
14 AC_CHECK_FUNCS([strerror_r])
15 if test $ac_cv_func_strerror_r = yes; then
16 AC_CHECK_HEADERS(string.h)
17 AC_CACHE_CHECK([for working strerror_r],
18 jm_cv_func_working_strerror_r,
28 int buf; /* avoiding square brackets makes this easier */
29 char x = *strerror_r (0, buf, sizeof buf);
31 jm_cv_func_working_strerror_r=yes,
32 jm_cv_func_working_strerror_r=no
34 if test $jm_cv_func_working_strerror_r = yes; then
35 AC_DEFINE_UNQUOTED(HAVE_WORKING_STRERROR_R, 1,
36 [Define to 1 if strerror_r returns a string.])