* m4/fcntl_h.m4 (gl_FCNTL_H_DEFAULTS): HAVE_OPENAT2 is now 1,
as glibc 2.43 (2026) supports it.
---
 ChangeLog                        |  4 ++++
 doc/glibc-functions/openat2.texi | 21 +++++++++++++++++++++
 doc/gnulib.texi                  |  2 ++
 m4/fcntl_h.m4                    |  4 ++--
 4 files changed, 29 insertions(+), 2 deletions(-)
 create mode 100644 doc/glibc-functions/openat2.texi

diff --git a/ChangeLog b/ChangeLog
index 884e6fe9f4..731cb8bd53 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2026-06-16  Paul Eggert  <[email protected]>
 
+       fcntl-h: glibc now has openat2
+       * m4/fcntl_h.m4 (gl_FCNTL_H_DEFAULTS): HAVE_OPENAT2 is now 1,
+       as glibc 2.43 (2026) supports it.
+
        openat2: fix prereq typo
        * modules/openat2 (configure.ac): Fix typo in spelling of prereq
        for gl_PREREQ_OPENAT2.
diff --git a/doc/glibc-functions/openat2.texi b/doc/glibc-functions/openat2.texi
new file mode 100644
index 0000000000..a29461fb59
--- /dev/null
+++ b/doc/glibc-functions/openat2.texi
@@ -0,0 +1,21 @@
+@node openat2
+@subsection @code{openat2}
+@findex openat2
+
+Documentation:@* 
@uref{https://www.kernel.org/doc/man-pages/online/pages/man2/openat2.2.html,,man
 openat2}
+
+Gnulib module: ---
+
+Portability problems fixed by Gnulib:
+@itemize
+@item
+This function is missing on most platforms:
+glibc 2.42 on Linux, glibc on non-Linux, all non-glibc platforms.
+@end itemize
+
+Portability problems not fixed by Gnulib:
+@itemize
+@item
+On platforms that do not natively support @code{openat2} functionality,
+the Gnulib emulation might not act atomically.
+@end itemize
diff --git a/doc/gnulib.texi b/doc/gnulib.texi
index 6cebe1d2a8..5589119a35 100644
--- a/doc/gnulib.texi
+++ b/doc/gnulib.texi
@@ -5723,6 +5723,7 @@ Glibc fcntl.h
 * name_to_handle_at::
 * readahead::
 * open_by_handle_at::
+* openat2::
 * sync_file_range::
 @end menu
 
@@ -5730,6 +5731,7 @@ Glibc fcntl.h
 @include glibc-functions/name_to_handle_at.texi
 @include glibc-functions/readahead.texi
 @include glibc-functions/open_by_handle_at.texi
+@include glibc-functions/openat2.texi
 @include glibc-functions/sync_file_range.texi
 
 @node Glibc fenv.h
diff --git a/m4/fcntl_h.m4 b/m4/fcntl_h.m4
index 946a0bd632..3a5ddb2219 100644
--- a/m4/fcntl_h.m4
+++ b/m4/fcntl_h.m4
@@ -1,5 +1,5 @@
 # fcntl_h.m4
-# serial 21
+# serial 22
 dnl Copyright (C) 2006-2007, 2009-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,
@@ -67,7 +67,7 @@ AC_DEFUN([gl_FCNTL_H_DEFAULTS]
   dnl Assume proper GNU behavior unless another module says otherwise.
   HAVE_FCNTL=1;          AC_SUBST([HAVE_FCNTL])
   HAVE_OPENAT=1;         AC_SUBST([HAVE_OPENAT])
-  HAVE_OPENAT2=0;        AC_SUBST([HAVE_OPENAT2])
+  HAVE_OPENAT2=1;        AC_SUBST([HAVE_OPENAT2]) dnl GNU/Linux only
   REPLACE_CREAT=0;       AC_SUBST([REPLACE_CREAT])
   REPLACE_FCNTL=0;       AC_SUBST([REPLACE_FCNTL])
   REPLACE_OPEN=0;        AC_SUBST([REPLACE_OPEN])
-- 
2.54.0


Reply via email to