From ad4a33a6fc2f4aafd8877a6299187260d8d3fb17 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 25 Jun 2023 18:19:06 +0200 Subject: [PATCH] strerrorname_np: Work around glibc bug on PowerPC, SPARC systems. * m4/strerrorname_np.m4 (gl_FUNC_STRERRORNAME_NP): Test also strerrorname_np (EDEADLOCK). * doc/glibc-functions/strerrorname_np.texi: Mention that glibc 2.36 still needs a workaround. --- ChangeLog | 8 ++++++++ doc/glibc-functions/strerrorname_np.texi | 3 ++- m4/strerrorname_np.m4 | 14 +++++++++++--- 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index e9cb20c330..4134d895c8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2023-06-25 Bruno Haible + + strerrorname_np: Work around glibc bug on PowerPC, SPARC systems. + * m4/strerrorname_np.m4 (gl_FUNC_STRERRORNAME_NP): Test also + strerrorname_np (EDEADLOCK). + * doc/glibc-functions/strerrorname_np.texi: Mention that glibc 2.36 + still needs a workaround. + 2023-06-19 Paul Eggert largefile: port to GNU/Linux s390x and alpha diff --git a/doc/glibc-functions/strerrorname_np.texi b/doc/glibc-functions/strerrorname_np.texi index 59a103e379..b9c6252b15 100644 --- a/doc/glibc-functions/strerrorname_np.texi +++ b/doc/glibc-functions/strerrorname_np.texi @@ -20,7 +20,8 @@ glibc 2.31, macOS 11.1, FreeBSD 13.0, NetBSD 9.0, OpenBSD 6.7, Minix 3.1.8, AIX @item This function returns wrong values on some platforms: @c https://sourceware.org/bugzilla/show_bug.cgi?id=26555 -glibc 2.32. +@c https://sourceware.org/bugzilla/show_bug.cgi?id=29545 +glibc 2.36. @end itemize Portability problems not fixed by Gnulib: diff --git a/m4/strerrorname_np.m4 b/m4/strerrorname_np.m4 index 461c6559c3..cb160e102d 100644 --- a/m4/strerrorname_np.m4 +++ b/m4/strerrorname_np.m4 @@ -1,5 +1,5 @@ -# strerrorname_np.m4 serial 2 -dnl Copyright (C) 2020-2022 Free Software Foundation, Inc. +# strerrorname_np.m4 serial 3 +dnl Copyright (C) 2020-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, dnl with or without modifications, as long as this notice is preserved. @@ -15,6 +15,9 @@ AC_DEFUN([gl_FUNC_STRERRORNAME_NP], dnl In glibc 2.32, strerrorname_np returns English error descriptions, not dnl error names. dnl See . + dnl In glibc 2.36, strerrorname_np returns NULL for EDEADLOCK on powerpc and + dnl sparc platforms. + dnl See . AC_CACHE_CHECK([whether strerrorname_np works], [gl_cv_func_strerrorname_np_works], [AC_RUN_IFELSE( @@ -22,7 +25,12 @@ AC_DEFUN([gl_FUNC_STRERRORNAME_NP], [[#include #include ]], - [[return strcmp (strerrorname_np (EINVAL), "EINVAL") != 0; + [[return + strcmp (strerrorname_np (EINVAL), "EINVAL") != 0 + #ifdef EDEADLOCK + || strerrorname_np (EDEADLOCK) == NULL + #endif + ; ]])], [gl_cv_func_strerrorname_np_works=yes], [gl_cv_func_strerrorname_np_works=no], -- 2.39.5