Re: git: d549de769055 - main - libc: Remove readdir_r(3) [This broke building rust 1.88]
- Reply: Dag-Erling_Smørgrav : "Re: git: d549de769055 - main - libc: Remove readdir_r(3) [This broke building rust 1.88]"
- In reply to: Olivier Certner : "Re: git: d549de769055 - main - libc: Remove readdir_r(3) [This broke building rust 1.88]"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 12 Sep 2025 13:58:31 UTC
Olivier Certner wrote in
<5035133.Cjmsv3J8Qz@ravel>:
|> readdir_r() should never have existed.
...
|most programs calling it do not do the proper dance[.]
...
|Yes, that's a fundamental problem for a flexible unionfs where the \
|upper and lower layers can be changed underneath the union view. But \
|we have a workaround here: Simply return NAME_MAX[.]
...
|>[.]It is
|> also faster than readdir_r().
|
|I completely agree, but see these more as points to actually obsolete \
|readdir_r(), as POSIX just did (and we did long ago). We'll eventually \
|remove it anyway.
Only to mention that POSIX Issue 8 has posix_getdents() that
gives application programmers a good tool for flexible buffer
usage ("none to many" dirents in one go, as you need it), as well
as lots of *stat*(2) avoidance possibilities. This is a real
improvement when available, and i hope the world will go this
route, so that the only optional getdirentries() / getdents()
/ getdents64() / readdir()+stat() dances will come to an end in
the future.
--steffen
|
|Der Kragenbaer, The moon bear,
|der holt sich munter he cheerfully and one by one
|einen nach dem anderen runter wa.ks himself off
|(By Robert Gernhardt)