[PATCH] io: Refactor {n}ftw to use fts for stack safety and conformance (BZ 33882)

Florian Weimer fw@deneb.enyo.de
Mon Feb 16 20:18:23 GMT 2026


* Adhemerval Zanella Netto:

> The resulting patch requires to import some gnulib modules [1], and adapt it
> to the glibc (LFS, 64-bit time, linknamespace and PLT fixes); but it does
> not trigger any regression.  And taking in consideration this is the
> implementation used on findutils and coreutils I think it should be
> battle proven.
>
> I extended the FTS/FTS64 struct with the fields required for the gnulib
> support options (FTS_TIGHT_CYCLE_CHECK, FTS_CWDFD, FTS_DEFER_STAT,
> FTS_VERBATIM, and FTS_MOUNT) and assuming application do not allocate
> or embedded the struct it should be backward compatible.
>
> I did not see much meaningful performance difference for {n}ftw, although
> I think we can simplify the nftw refactor with the newer flags FTS_CWDFD.
> The gnulib fixes two longstanding issues (BZ 22944, BZ 20331).
>
> [1] https://sourceware.org/git/?p=glibc.git;a=commit;h=82e60c6e48116d3d33abf12b22707047f199f0ea

There are some licensing issues.  At least io/cycle-check.c is GPLv3.


More information about the Libc-alpha mailing list