From a4bb069a1180e7cc69cc6dd32484603a2a2e9da1 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 | 12 ++++++++++-- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index b720f233b8..ec723a64fb 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 7e68bf7a91..cb160e102d 100644 --- a/m4/strerrorname_np.m4 +++ b/m4/strerrorname_np.m4 @@ -1,4 +1,4 @@ -# strerrorname_np.m4 serial 2 +# 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, @@ -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