Skip to content

Conversation

@LGFae
Copy link
Contributor

@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).
@sunfishcode sunfishcode merged commit bb00248 into bytecodealliance:main Dec 23, 2025
49 of 50 checks passed
@sunfishcode
Copy link
Member

This is now released in rustix 1.1.3.

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

2 participants