+2025-09-20 Bruno Haible <bruno@clisp.org>
+
+ nl_langinfo: Work around nl_langinfo multithread-safety bug on macOS 26.
+ * m4/nl_langinfo.m4 (gl_FUNC_NL_LANGINFO): Set NL_LANGINFO_MTSAFE to 0
+ on macOS.
+ * lib/nl_langinfo.c (ITEMS): Define appropriately on macOS.
+ * doc/posix-functions/nl_langinfo.texi: Document the macOS bug.
+
2025-09-20 Paul Eggert <eggert@cs.ucla.edu>
fchownat: fix unlikely EOVERFLOW bug
OpenBSD 7.5.
@item
This function is not multithread-safe on some platforms:
-Solaris 11.3.
+macOS 26, Solaris 11.3.
@end itemize
Portability problems not fixed by Gnulib:
"thread5 disturbed by threadN!", even when threadN invokes only
nl_langinfo (CODESET);
nl_langinfo (CRNCYSTR);
- Similarly on Solaris 10. */
+ Similarly on Solaris 10 and macOS 26. */
-# if !NL_LANGINFO_MTSAFE /* Solaris */
+# if !NL_LANGINFO_MTSAFE /* macOS, Solaris */
-# define ITEMS (MAXSTRMSG + 1)
+# ifdef __sun /* Solaris */
+# define ITEMS (MAXSTRMSG + 1)
+# else /* macOS */
+# define ITEMS (CRNCYSTR + 20)
+# endif
# define MAX_RESULT_LEN 80
static char *
# nl_langinfo.m4
-# serial 13
+# serial 14
dnl Copyright (C) 2009-2025 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_PTHREADLIB])
AC_CHECK_HEADERS_ONCE([threads.h])
if test $ac_cv_func_nl_langinfo = yes; then
- # On Solaris 10 and Solaris 11.3, nl_langinfo is not multithread-safe.
+ # On macOS 26, Solaris 10, and Solaris 11.3, nl_langinfo is not
+ # multithread-safe.
case "$host_os" in
- solaris*) NL_LANGINFO_MTSAFE=0 ;;
- *) NL_LANGINFO_MTSAFE=1 ;;
+ darwin* | solaris*) NL_LANGINFO_MTSAFE=0 ;;
+ *) NL_LANGINFO_MTSAFE=1 ;;
esac
AC_DEFINE_UNQUOTED([NL_LANGINFO_MTSAFE], [$NL_LANGINFO_MTSAFE],
[Define to 1 if nl_langinfo is multithread-safe.])