Paul Eggert wrote: > * lib/fcntl.in.h (O_SEARCH): Redefine to O_RDONLY on musl, > which mistakenly defines it to be O_PATH on GNU/Linux. > Problem reported by Lasse Collin in: > https://bugs.gnu.org/75405
Let me document it: 2025-01-08 Bruno Haible <br...@clisp.org> doc: Document the previous change. * doc/posix-headers/fcntl.texi: Document O_SEARCH musl workaround. diff --git a/doc/posix-headers/fcntl.texi b/doc/posix-headers/fcntl.texi index 246cc0a881..6f85ca663a 100644 --- a/doc/posix-headers/fcntl.texi +++ b/doc/posix-headers/fcntl.texi @@ -56,12 +56,10 @@ 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_SEARCH} is defined to @code{O_PATH} on some platforms: +@c https://bugs.gnu.org/75405 +musl libc. @item @samp{O_ACCMODE} is not defined on some platforms: