[PATCH] io: statx, fstatat64: allow using NULL as path

Sam James sam@gentoo.org
Tue Jun 16 19:07:49 GMT 2026


On Wed, 25 Sep 2024 22:23:14 +0800, Xi Ruoyao wrote:
>> [...]
>  I'd suggest to separate this into two patches.  The first one drops the
> __nonnull(...) on the path, the second one implements the fallback.  The
> first patch would be so obvious to be applied then.

Paul has fixed this today in gnulib:

commit 6db27b4dd36eda618db20e997ff56bbed7fce3cb
Author:     Paul Eggert <eggert@cs.ucla.edu>
AuthorDate: Tue Jun 16 09:45:39 2026 -0700
Commit:     Paul Eggert <eggert@cs.ucla.edu>
CommitDate: Tue Jun 16 09:53:22 2026 -0700

    fstatat etc.: fix wrong machine code for calls

    Without this fix, compilers can generate incorrect machine code
    for functions that call to fstatat-like functions, as the
    compilers incorrectly assume that the calls’ arguments cannot be
    null pointers.  This assumption became false with the release of
    Linux kernel 6.11 (2024).
    * lib/sys_stat.in.h (fchmodat, fstatat, utimensat):
    * lib/unistd.in.h (faccessat, fchownat): Do not mark file args
    with _GL_ARG_NONNULL, as the args are allowed to be null pointers
    in Linux kernel 6.11+, possibly with glibc 2.41+ involved.

Miao Wang, do you intend to pursue this patch, or Paul, do you intend to
submit a similar change (the attribute fix is what I care about, anyway)
on the glibc side? If not, I can look at syncing it.

sam
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 418 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/libc-alpha/attachments/20260616/3f51caab/attachment-0001.sig>


More information about the Libc-alpha mailing list