On 22/11/2026 23:19, Paul Eggert wrote:
On 2026-11-22 11:19, Pádraig Brady wrote:
I noticed the existing FSTAT_O_PATH_BUG define internal to openat2.c
which would simplify some code I'm working on in coreutils chmod.c,
so the attached provides this through a HAVE_WORKING_FSTAT_O_PATH define.
Thanks, looks good and further suggestions:

Add a note to doc/posix-functions/fstatat.texi about O_PATH that is like the 
revised note in doc/posix-functions/fstat.texi.

Oh I see glibc uses fstatat(fd, "", buf, AT_EMPTY_PATH) rather than fstat(fd, 
buf)
as it comments that the former is compat with these 2.6.39 - 3.5 kernels.
I'll update the docs for fstat along those lines.

fstat() is cleaner and simpler for newer code,
so I'll keep the configure define available.

Break out the code added to gl_FCNTL_O_FLAGS into a new macro, say 
gl_WORKING_FSTAT_O_PATH, and have gl_PREREQ_OPENAT2 call 
gl_WORKING_FSTAT_O_PATH. That way, 'configure' will go to the work of checking 
for this only in programs that need the check.

Good point.
I've adjusted to only calling this where required.

I pushed with those changes.

cheers,
Padraig


Reply via email to