Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Sep 2025 13:56:26 +0200
From:      Olivier Certner <olce@freebsd.org>
To:        Bob Bishop <rb@gid.co.uk>, Dag-Erling =?UTF-8?B?U23DuHJncmF2?= <des@freebsd.org>
Cc:        FreeBSD Current <freebsd-current@freebsd.org>, Alan Somers <asomers@freebsd.org>, Toomas Soome <tsoome@me.com>
Subject:   Re: git: d549de769055 - main - libc: Remove readdir_r(3) [This broke building rust 1.88]
Message-ID:  <6053312.Zv9zXsTiuT@ravel>
In-Reply-To: <86qzwcgcmp.fsf@ltc.des.dev>
References:  <0F481EDD-24F4-4F2C-BCBB-9B016DD313F3@gid.co.uk> <86qzwcgcmp.fsf@ltc.des.dev>

index | next in thread | previous in thread | raw e-mail

[-- Attachment #1 --]
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
[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----

iQIzBAABCQAdFiEEmNCxHjkosai0LYIujKEwQJceJicFAmjECmoACgkQjKEwQJce
Jif5UA//YVbO43Irdyq58D1vgSS7euVHahh9Rjoptdx/NrP6NG1RtC24D6FA5HH3
RosLp+W6D5+vLXIIV+XHJea8BsI4TIVMoWPKdA5Tqzm2XEk4/6yf3luLOOlu7pdi
OMsafl8elSM0AT6lEym+X/3CrlH82Us7Iv/rMEG4p4aWL2y4F61ZkmKlLnC9IzSr
wGYcreIt5XHR/9zqcPSgyAmHXIpjrWz1V5bM/F/TAZ4PtlCVwM2o7tgHChMEKU3i
gm4zZvTMrmVlO34LCeXZoBtr5hKoznesLX8tdm0ijbFs2MtWQ175TM38++2MIUVQ
/g1oFeKj2zf2GnpZnkxachbX9+oZvWPEjm3W9rtfKpHmiRv2RxdbEm1xLFzysaJm
pp6sJqBKuSAuDbuhsJeBS0ozEmWwkPF7UB+ZRY+7TNmXwospv5D6wOhfNExpHrQi
wwa6QCX9RtqM9ObFfzNyC2f3VD0FUmmT1frxK27O9bsa8c/OTzykRFxqfU+Acp/I
2BseHnym3hDzk3WZ9LpP38cTpjbkI9QYS67K6qjKHpS5hpTddMGY7CaQ/uj5Orlo
DbTQ+HNoInM7qx3xzpmQN6AT5WCxzCFeqiSTi5VVs1uKOKZdtBvKPdHNU7WhZn1Y
QTFvkQPD/BzKZPcCLJx70plxafCmyaPffbzCWkQEuQ2ZKc9w4Oo=
=ePn7
-----END PGP SIGNATURE-----
home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6053312.Zv9zXsTiuT>