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: Dag-Erling_Smørgrav : "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 11:56:26 UTC
Hi, > The only argument in favor of readdir_r() was thread safety because some > readdir() implementations used to return a pointer to a static buffer, > but was never the case for FreeBSD. True, but most software isn't written for FreeBSD specifically, and some intends to be more or less portable. > Our readdir() is thread-safe as long as you don't have multiple threads operating on the same DIR. Only the latest POSIX release (Issue 8, 2024) amended the wording to unequivocally require that, even if previous versions could be considered to hint at that. I did not survey some other open-source implementations, maybe in practice they all meet that requirement. But even if they do, we don't really know about proprietary systems. Also, readdir_r() has just been obsoleted in Issue 8, only a year ago, so again I don't understand the hurry in actually *removing* it unless there is a clear security issue or it is actively obstructing some other grand plan. Hence, I'll point again to https://reviews.freebsd.org/D52474. Thanks and regards. -- Olivier Certner