Implement AsRawFd and FromRawFd for ReadDir #56777
Labels
C-feature-request
Category: A feature request, i.e: not implemented / a PR.
T-libs-api
Relevant to the library API team, which will review and decide on the PR/issue.
Most unixes provide
dirfd()
, which can be used to get a file descriptor fromstruct DIR *
.The two errors are
EINVAL
(dirfd
called on invalid pointer), which can't occur in correct code, andENOTSUP
(not supported by implementation), which doesn't occur on most implementations.Most unixes also provide
fdopendir()
, which opens a file descriptor asstruct DIR *
. It fails if the file descriptor is invalid or if it fails to allocate memory.The text was updated successfully, but these errors were encountered: