-
Notifications
You must be signed in to change notification settings - Fork 824
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
Added '.' and '..' special folder t WASI fd_readdir return (for #3033) #3065
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1321,6 +1321,10 @@ pub fn fd_readdir<M: MemorySize>( | |
(entry.name.to_string(), stat.st_filetype, stat.st_ino) | ||
}), | ||
); | ||
// adding . and .. special folders | ||
// TODO: inode | ||
entry_vec.push((".".to_string(), __WASI_FILETYPE_DIRECTORY, 0)); | ||
entry_vec.push(("..".to_string(), __WASI_FILETYPE_DIRECTORY, 0)); | ||
Comment on lines
+1326
to
+1327
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ummm... what about the root? We shouldn't add There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But, isn't Root the next There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, side comment. Do you have insight on why our fix is quite different from wasmtime's one? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What I hesitated is adding "." to a root readdir There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the root cause was completly different: it's not a buffer size issue here, it's the missing "." and "..". All the 201 folder appears correctly, just missing the special folders There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So no, adding "." to fd_readdir of root is a bad idea, it breaks things (tests that read root). |
||
entry_vec.sort_by(|a, b| a.0.cmp(&b.0)); | ||
entry_vec | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this TODO?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as line 1310