Pádraig Brady wrote: > > It sounds like gl_CHECK_STRERRORNAME_NP could be augmented to checking > > EFTYPE > > like it does for other problematic errnos.
Collin Funk wrote: > And then a kernel upgrade to could invalidate that anyways. I don't > think it is worth the effort. I agree with Pádraig, and I disagree with Collin. Even if we can't fix the problem once and for all, for all possible new errno values that will be added the future, it's worth the effort to handle this one in Gnulib. It reduces the time window in which users may see programs crash, even if it can't eliminate them. 2026-09-16 Bruno Haible <[email protected]> strerrorname_np: Ensure it handles EFTYPE. Suggested by Pádraig Brady. * m4/strerrorname_np.m4 (gl_CHECK_STRERRORNAME_NP): Test whether strerrorname_np handles EFTYPE. * lib/strerrorname_np.c: Update comment. * lib/errno-iter.c: Likewise. * tests/test-strerrorname_np.c: Likewise. diff --git a/lib/errno-iter.c b/lib/errno-iter.c index 7cfa0ba8db..aa2e26ccc4 100644 --- a/lib/errno-iter.c +++ b/lib/errno-iter.c @@ -486,7 +486,7 @@ errno_iterate (errno_iterate_callback_fn callback, void *data) #if defined EFRAGS if (callback (data, EFRAGS)) return; #endif - /* Mac OS X, FreeBSD, NetBSD, OpenBSD, Minix, Cygwin */ + /* Linux, Mac OS X, FreeBSD, NetBSD, OpenBSD, Minix, Cygwin */ #if defined EFTYPE if (callback (data, EFTYPE)) return; #endif diff --git a/lib/strerrorname_np.c b/lib/strerrorname_np.c index 320d5c507d..f6ba15995d 100644 --- a/lib/strerrorname_np.c +++ b/lib/strerrorname_np.c @@ -486,7 +486,7 @@ strerrorname_np (int errnum) #if defined EFRAGS case EFRAGS: return "EFRAGS"; #endif - /* Mac OS X, FreeBSD, NetBSD, OpenBSD, Minix, Cygwin */ + /* Linux, Mac OS X, FreeBSD, NetBSD, OpenBSD, Minix, Cygwin */ #if defined EFTYPE case EFTYPE: return "EFTYPE"; #endif diff --git a/m4/strerrorname_np.m4 b/m4/strerrorname_np.m4 index 7dfb615497..d1462baca8 100644 --- a/m4/strerrorname_np.m4 +++ b/m4/strerrorname_np.m4 @@ -1,5 +1,5 @@ # strerrorname_np.m4 -# serial 8 +# serial 9 dnl Copyright (C) 2020-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -45,6 +45,8 @@ AC_DEFUN([gl_CHECK_STRERRORNAME_NP] dnl In glibc 2.37, strerrorname_np returns NULL for ENOSYM and dnl EREMOTERELEASE on hppa platforms. dnl See <https://sourceware.org/PR31080>. + dnl In glibc 2.43, strerrorname_np returns NULL for EFTYPE. + dnl See <https://bugzilla.redhat.com/show_bug.cgi?id=2533579>. dnl In Solaris 11 OmniOS, strerrorname_np returns NULL for ERESTART dnl and ESTRPIPE. dnl see <https://www.illumos.org/issues/17134>. @@ -63,6 +65,9 @@ AC_DEFUN([gl_CHECK_STRERRORNAME_NP] #ifdef ENOSYM || strerrorname_np (ENOSYM) == NULL #endif + #ifdef EFTYPE + || strerrorname_np (EFTYPE) == NULL + #endif #ifdef ERESTART || strerrorname_np (ERESTART) == NULL #endif diff --git a/tests/test-strerrorname_np.c b/tests/test-strerrorname_np.c index 08fa2e3506..e4b9c085a3 100644 --- a/tests/test-strerrorname_np.c +++ b/tests/test-strerrorname_np.c @@ -485,7 +485,7 @@ main (void) #if defined EFRAGS ASSERT (streq (strerrorname_np (EFRAGS), "EFRAGS")); #endif - /* Mac OS X, FreeBSD, NetBSD, OpenBSD, Minix, Cygwin */ + /* Linux, Mac OS X, FreeBSD, NetBSD, OpenBSD, Minix, Cygwin */ #if defined EFTYPE ASSERT (streq (strerrorname_np (EFTYPE), "EFTYPE")); #endif
