Re: git: d549de769055 - main - libc: Remove readdir_r(3) [This broke building rust 1.88]
Date: Mon, 15 Sep 2025 17:13:52 UTC
rb@gid.co.uk writes: > Dag-Erling Smørgrav <des@FreeBSD.org> writes: > > No, because readdir_r() has no way of knowing the size of the buffer > > that was passed to it. > It doesn’t need to know. > > If NAME_MAX is defined, the user must supply an adequately sized > buffer (based on NAME_MAX) or shoot themselves in the foot. > > If NAME_MAX is indefinite, readdir_r() returns EOVERFLOW immediately. “we have this neat function called readdir_r(), you should try it, it's slower than readdir() and more difficult to use and sometimes it doesn't work so you have to be prepared to fall back to readdir() when that happens, but apart from that I really like it” DES -- Dag-Erling Smørgrav - des@FreeBSD.org