Skip to content

readdir_r is deprecated as of glibc-2.24 #34668

Closed
@cuviper

Description

@cuviper

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-enhancementCategory: An issue proposing an enhancement or a PR with one.T-libsRelevant to the library team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions