Per bug 19056, glibc-2.24 has deprecated readdir_r and readdir64_r in favor of plain readdir and readdir64. The reasons are discussed on the updated manpage.
It states that readdir is already thread-safe in "modern" implementations, including glibc. We should see if all platforms targeted by unix/fs.rs satisfy this. Note that the Solaris (Illumos) port is already using plain readdir.
It requires external synchronization if a particular directory stream may be shared among threads, but I believe we avoid that naturally from the lack of &mut aliasing. Dir is Sync, but only ReadDir accesses it, and only from its mutable Iterator implementation.
Per bug 19056, glibc-2.24 has deprecated
readdir_randreaddir64_rin favor of plainreaddirandreaddir64. The reasons are discussed on the updated manpage.It states that
readdiris already thread-safe in "modern" implementations, including glibc. We should see if all platforms targeted byunix/fs.rssatisfy this. Note that the Solaris (Illumos) port is already using plainreaddir.It requires external synchronization if a particular directory stream may be shared among threads, but I believe we avoid that naturally from the lack of
&mutaliasing.DirisSync, but onlyReadDiraccesses it, and only from its mutableIteratorimplementation.