]> Savannah Git Hosting - gnulib.git/commitdiff
doc: Add more details about O_EXEC and O_SEARCH.
authorBruno Haible <bruno@clisp.org>
Wed, 28 Aug 2024 09:03:34 +0000 (11:03 +0200)
committerBruno Haible <bruno@clisp.org>
Wed, 28 Aug 2024 09:03:34 +0000 (11:03 +0200)
* doc/posix-headers/fcntl.texi: Add platforms list and revisit note
about O_EXEC and O_SEARCH.

ChangeLog
doc/posix-headers/fcntl.texi

index d7124060b8a30b1f200f9113546bed1d4f0b1d3c..8a7f812b67d48893969ddd0ddefc8538b4c73d23 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2024-08-28  Bruno Haible  <bruno@clisp.org>
+
+       doc: Add more details about O_EXEC and O_SEARCH.
+       * doc/posix-headers/fcntl.texi: Add platforms list and revisit note
+       about O_EXEC and O_SEARCH.
+
 2024-08-27  Bruno Haible  <bruno@clisp.org>
 
        mcel: Fix compilation error with MSVC.
index c7ffba8cf4d2f2a865de66d63005562c757f22ed..b190761e6a4a475a664c4dc88cfd434bfec10988 100644 (file)
@@ -36,11 +36,30 @@ which is generally safe.
 non-zero value; otherwise, the gnulib replacement is 0.
 
 @item
-@samp{O_EXEC} and @samp{O_SEARCH} are not defined on some platforms.
-Gnulib defines these macros to @samp{O_RDONLY}, which is typically 0.
-The @samp{O_PATH} macro of GNU/Linux is not a suitable substitute, as
-fchmod fails with @samp{errno==EBADF} when invoked on a file
-descriptor that was opened with @samp{O_PATH}.
+@samp{O_EXEC} is not defined on some platforms:
+glibc 2.40, macOS 12, FreeBSD 7.4, NetBSD 9.4, OpenBSD 7.5, HP-UX 11, Solaris 10, Cygwin 1.5.x, mingw, MSVC 14, Android.
+When not otherwise defined,
+Gnulib defines this macro to @samp{O_RDONLY}, which is typically 0.
+
+Note: @samp{O_EXEC} is not suitable for opening a file descriptor
+that you want to use with @code{fchmod} later, because
+musl libc defines @samp{O_EXEC} to @code{O_PATH} and
+@c https://lists.gnu.org/archive/html/bug-gnulib/2012-11/msg00029.html
+Linux @code{fchmod} fails with error @code{EBADF} when given such a file
+descriptor.
+
+@item
+@samp{O_SEARCH} is not defined on some platforms:
+glibc 2.40, macOS 12, FreeBSD 12.4, NetBSD 6.1, OpenBSD 7.5, AIX 6.1, HP-UX 11, Solaris 10, Cygwin 1.5.x, mingw, MSVC 14, Android.
+When not otherwise defined,
+Gnulib defines this macro to @samp{O_RDONLY}, which is typically 0.
+
+Note: @samp{O_SEARCH} is not suitable for opening a file descriptor
+that you want to use with @code{fchmod} later, because
+musl libc defines @samp{O_EXEC} to @code{O_PATH} and
+@c https://lists.gnu.org/archive/html/bug-gnulib/2012-11/msg00029.html
+Linux @code{fchmod} fails with error @code{EBADF} when given such a file
+descriptor.
 
 @item
 @samp{O_ACCMODE} is not defined on some platforms: