[PATCH v2 02/25] Add EFTYPE from Linux 7.2 to bits/errno.h

Adhemerval Zanella adhemerval.zanella@linaro.org
Tue Nov 10 15:09:46 GMT 2026


Linux 7.2 adds the EFTYPE error code (commit
cf1b04aaef8b83f668fac10bfc4d4d76ba6e6fa1), returned by openat2 with
OPENAT2_REGULAR when the file is not a regular file.

The errlist.h entry for EFTYPE already exists (it is used on Hurd), so
glibc built against Linux 7.2 or newer headers already includes it in
the error list.  Add the fallback definitions to bits/errno.h, as done
for ERFKILL and EHWPOISON, so the strerror and strerrorname_np results
do not depend on the kernel headers version used to build glibc.

strerror reports the existing errlist.h message, "Inappropriate file
type or format", which is shared with Hurd.
---
 manual/errno.texi                          | 3 ---
 sysdeps/gnu/errlist.h                      | 5 +----
 sysdeps/unix/sysv/linux/alpha/bits/errno.h | 4 ++++
 sysdeps/unix/sysv/linux/bits/errno.h       | 4 ++++
 sysdeps/unix/sysv/linux/hppa/bits/errno.h  | 4 ++++
 sysdeps/unix/sysv/linux/mips/bits/errno.h  | 4 ++++
 sysdeps/unix/sysv/linux/sparc/bits/errno.h | 4 ++++
 7 files changed, 21 insertions(+), 7 deletions(-)

diff --git a/manual/errno.texi b/manual/errno.texi
index a27223c14f8..268a5002f4d 100644
--- a/manual/errno.texi
+++ b/manual/errno.texi
@@ -728,9 +728,6 @@ operating system.
 @errno{EFTYPE, 79, Inappropriate file type or format}
 The file was the wrong type for the
 operation, or a data file had the wrong format.
-
-On some systems @code{chmod} returns this error if you try to set the
-sticky bit on a non-directory file; @pxref{Setting Permissions}.
 @end deftypevr
 
 @deftypevr Macro int EAUTH
diff --git a/sysdeps/gnu/errlist.h b/sysdeps/gnu/errlist.h
index d7d907a70fa..30867aa083b 100644
--- a/sysdeps/gnu/errlist.h
+++ b/sysdeps/gnu/errlist.h
@@ -689,10 +689,7 @@ _S(EBADRPC, N_("RPC struct is bad"))
 #ifdef EFTYPE
 /*
 TRANS The file was the wrong type for the
-TRANS operation, or a data file had the wrong format.
-TRANS
-TRANS On some systems @code{chmod} returns this error if you try to set the
-TRANS sticky bit on a non-directory file; @pxref{Setting Permissions}. */
+TRANS operation, or a data file had the wrong format. */
 _S(EFTYPE, N_("Inappropriate file type or format"))
 #endif
 #ifdef EPROCUNAVAIL
diff --git a/sysdeps/unix/sysv/linux/alpha/bits/errno.h b/sysdeps/unix/sysv/linux/alpha/bits/errno.h
index e876708c440..bc4322fdaf7 100644
--- a/sysdeps/unix/sysv/linux/alpha/bits/errno.h
+++ b/sysdeps/unix/sysv/linux/alpha/bits/errno.h
@@ -50,4 +50,8 @@
 #  define EHWPOISON		139
 # endif
 
+# ifndef EFTYPE
+#  define EFTYPE		140
+# endif
+
 #endif /* bits/errno.h.  */
diff --git a/sysdeps/unix/sysv/linux/bits/errno.h b/sysdeps/unix/sysv/linux/bits/errno.h
index be4e48e63c2..b45f3804a93 100644
--- a/sysdeps/unix/sysv/linux/bits/errno.h
+++ b/sysdeps/unix/sysv/linux/bits/errno.h
@@ -50,4 +50,8 @@
 #  define EHWPOISON		133
 # endif
 
+# ifndef EFTYPE
+#  define EFTYPE		134
+# endif
+
 #endif /* bits/errno.h.  */
diff --git a/sysdeps/unix/sysv/linux/hppa/bits/errno.h b/sysdeps/unix/sysv/linux/hppa/bits/errno.h
index 6365fea026b..fdd6e5e1b45 100644
--- a/sysdeps/unix/sysv/linux/hppa/bits/errno.h
+++ b/sysdeps/unix/sysv/linux/hppa/bits/errno.h
@@ -50,4 +50,8 @@
 #  define EHWPOISON		257
 # endif
 
+# ifndef EFTYPE
+#  define EFTYPE		258
+# endif
+
 #endif /* bits/errno.h.  */
diff --git a/sysdeps/unix/sysv/linux/mips/bits/errno.h b/sysdeps/unix/sysv/linux/mips/bits/errno.h
index 7625a847c07..f16295b3c52 100644
--- a/sysdeps/unix/sysv/linux/mips/bits/errno.h
+++ b/sysdeps/unix/sysv/linux/mips/bits/errno.h
@@ -49,4 +49,8 @@
 #  define EHWPOISON		168
 # endif
 
+# ifndef EFTYPE
+#  define EFTYPE		169
+# endif
+
 #endif /* bits/errno.h.  */
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/errno.h b/sysdeps/unix/sysv/linux/sparc/bits/errno.h
index 8ce0ab1d9b8..58d873485b1 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/errno.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/errno.h
@@ -50,4 +50,8 @@
 #  define EHWPOISON		135
 # endif
 
+# ifndef EFTYPE
+#  define EFTYPE		136
+# endif
+
 #endif /* bits/errno.h.  */
-- 
2.53.0



More information about the Libc-alpha mailing list