rustix
rustix copied to clipboard
Implement dirfd equivalent functions
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).