Skip to content

Implement AsRawFd and FromRawFd for ReadDir #56777

@hvenev

Description

@hvenev

Most unixes provide dirfd(), which can be used to get a file descriptor from struct DIR *.

The two errors are EINVAL (dirfd called on invalid pointer), which can't occur in correct code, and ENOTSUP (not supported by implementation), which doesn't occur on most implementations.

Most unixes also provide fdopendir(), which opens a file descriptor as struct DIR *. It fails if the file descriptor is invalid or if it fails to allocate memory.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-feature-requestCategory: A feature request, i.e: not implemented / a PR.T-libs-apiRelevant to the library API 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