* lib/strerror_r.c: Ignore the value of STRERROR_R_CHAR_P on AIX.
* m4/strerror_r.m4 (gl_FUNC_STRERROR_R): Don't define
_LINUX_SOURCE_COMPAT, since it provides no advantage for strerror_r.
+2024-08-01 Bruno Haible <bruno@clisp.org>
+
+ strerror_r: Fix for AIX (regression yesterday).
+ * lib/strerror_r.c: Ignore the value of STRERROR_R_CHAR_P on AIX.
+ * m4/strerror_r.m4 (gl_FUNC_STRERROR_R): Don't define
+ _LINUX_SOURCE_COMPAT, since it provides no advantage for strerror_r.
+
2024-07-31 Paul Eggert <eggert@cs.ucla.edu>
errno: make EEXIST != ENOTEMPTY on AIX
#include "strerror-override.h"
-#if STRERROR_R_CHAR_P
+#if STRERROR_R_CHAR_P && !defined _AIX
# if HAVE___XPG_STRERROR_R
_GL_EXTERN_C int __xpg_strerror_r (int errnum, char *buf, size_t buflen);
int ret;
int saved_errno = errno;
-#if STRERROR_R_CHAR_P
+ /* Due to the '#undef strerror_r' above, on AIX, we're always using
+ the POSIX-compatible strerror_r function, regardless whether
+ _LINUX_SOURCE_COMPAT is defined or not. */
+#if STRERROR_R_CHAR_P && !defined _AIX
{
ret = 0;
# strerror_r.m4
-# serial 27
+# serial 28
dnl Copyright (C) 2002, 2007-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
AC_REQUIRE([gl_STRING_H_DEFAULTS])
AC_REQUIRE([gl_FUNC_STRERROR_R_WORKS])
- dnl On AIX, ask for the GNU/Linux API. Other modules might ask for
- dnl that API for other reasons, so we will will need override it because
- dnl we cannot easily ask AIX for the GNU/Linux API for everything
- dnl but strerror_r.
- AC_DEFINE([_LINUX_SOURCE_COMPAT], [1],
- [Define so that AIX headers are more compatible with GNU/Linux.])
-
dnl Some systems don't declare strerror_r() if _THREAD_SAFE and _REENTRANT
dnl are not defined.
AC_CHECK_DECLS_ONCE([strerror_r])