-
Notifications
You must be signed in to change notification settings - Fork 353
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement a readdir64() shim for Linux #1981
Conversation
This doesn't quite work yet, but I think I need some help to fix it. I'm allocating the My libstd patch was supposed to handle this by using
|
Hmm I guess this is just a libstd bug. |
Indeed, |
That's great, thanks a lot. :) I hadn't even thought of creating a new allocation for each call, but it makes a lot of sense. |
Another one for the trophy case? :P |
I guess we could add it. ;) |
ptr::addr_of!((*ptr).field) still requires ptr to point to an appropriate allocation for its type. Since the pointer returned by readdir() can be smaller than sizeof(struct dirent), we need to entirely avoid dereferencing it as that type. Link: rust-lang/miri#1981 (comment) Link: rust-lang#93459 (comment)
☔ The latest upstream changes (presumably #1970) made this pull request unmergeable. Please resolve the merge conflicts. |
…=cuviper fs: Don't dereference a pointer to a too-small allocation ptr::addr_of!((*ptr).field) still requires ptr to point to an appropriate allocation for its type. Since the pointer returned by readdir() can be smaller than sizeof(struct dirent), we need to entirely avoid dereferencing it as that type. Link: rust-lang/miri#1981 (comment) Link: rust-lang#93459 (comment)
☔ The latest upstream changes (presumably #2005) made this pull request unmergeable. Please resolve the merge conflicts. |
In preparation to use it for other runtime-internal allocations.
Partial fix for rust-lang#1966.
(Looks at the force-push diff, confused) oh, you rebased! That makes force-push diffs harder to read so please only do it when needed to resolve conflicts. :) |
Looking great, thanks a lot for staying with me through the many rounds of review. :) @bors r+ |
📌 Commit 0886419 has been approved by |
☀️ Test successful - checks-actions |
Partial fix for #1966.