Skip to content

Conversation

@LGFae
Copy link

@LGFae LGFae commented Nov 18, 2025

Implement functions that allow us to retrieve the directory stream file descriptor, equivalent to libc's dirfd function.

On linux, we can simply return the file descriptor itself (I verified this is what musl does).


This fixes #1455. I've tried following rustix's style in general. Overall, it is a fairly simple change. I don't know if you want to add some tests for it or not (I may need a little bit of guidance in that case).

Implement functions that allow us to retrieve the directory stream file
descriptor, equivalent to libc's `dirfd` function.

On linux, we can simply return the file descriptor itself (I verified
this is what musl does).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consider adding a Dir::into_fd() method

1 participant