]> git.ipfire.org Git - thirdparty/gnulib.git/commit
fstatat: support NULL if AT_EMPTY_PATH master
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 18 Jun 2026 20:33:58 +0000 (13:33 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 18 Jun 2026 20:42:43 +0000 (13:42 -0700)
commitdac89368df384dad0283938a885363ca6b47ebd0
treeff1bad594208defebade25d84e13479785f4b57a
parentd7fac9e048b22f0b10034210b0a6ad0e7eda0466
fstatat: support NULL if AT_EMPTY_PATH

On platforms that define AT_EMPTY_PATH, allow a null pointer to be
passed as a file name.  This is GNU behavior as of glibc 2.41 +
Linux kernel 6.11, and can be supported on older kernels, older
glibcs, and on recent FreeBSD and z/OS.
* lib/fstatat.c (rpl_fstatat): Support AT_EMPTY_PATH,
if it exists, on null pointers.
* m4/fstatat.m4 (gl_FUNC_FSTATAT): Replace fstatat if
AT_EMPTY_PATH is defined but does not work on null pointers.
Also, define HAVE_WORKING_FSTATAT_ZERO_FLAG, if it is discovered,
regardless of whether replacing fstatat.  This refactoring makes
config.h a bit less confusing.
* tests/test-fstatat.c (main): Test AT_EMPTY_PATH if defined.
ChangeLog
doc/glibc-functions/statx.texi
doc/posix-functions/fstatat.texi
lib/fstatat.c
m4/fstatat.m4
tests/test-fstatat.c