+2023-01-11 Bruno Haible <bruno@clisp.org>
+
+ perror: Fix "perror clobbers strerror's buffer" problem on Android.
+ * m4/perror.m4 (gl_FUNC_PERROR): Set REPLACE_PERROR to 1 on Android.
+ * doc/posix-functions/perror.texi: Mention the Android problem.
+
2023-01-11 Bruno Haible <bruno@clisp.org>
posix_spawn_file_actions_addfchdir tests: Fix test failure on Android.
FreeBSD 8.2, OpenBSD 4.7, macOS 11.1.
@item
This function clobbers the @code{strerror} buffer on some platforms:
-Cygwin 1.7.9.
+Cygwin 1.7.9, Android 11.
@item
This function fails to print a useful a string for out-of-range integers on
some platforms:
-# perror.m4 serial 10
+# perror.m4 serial 11
dnl Copyright (C) 2008-2023 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_HEADER_ERRNO_H])
AC_REQUIRE([gl_FUNC_STRERROR_R])
AC_REQUIRE([gl_FUNC_STRERROR_0])
- AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_REQUIRE([AC_CANONICAL_HOST])
dnl We intentionally do not check for the broader REPLACE_STRERROR_R,
dnl since on glibc systems, strerror_r is replaced only for signature
dnl issues, and perror is just fine. Rather, we only want to
REPLACE_PERROR=1
;;
esac
+ dnl Does perror clobber the strerror buffer?
+ case "$host_os" in
+ # Yes on Android 11.
+ linux*-android*) REPLACE_PERROR=1 ;;
+ esac
])