wasix: report stdin fd type in fd_fdstat_get from actual fd kind - #6699
Open
Whadup wants to merge 1 commit into
Open
wasix: report stdin fd type in fd_fdstat_get from actual fd kind#6699Whadup wants to merge 1 commit into
Whadup wants to merge 1 commit into
Conversation
marxin
requested review from
Arshia001 and
theduke
and removed request for
Arshia001
June 11, 2026 07:23
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aims to improve WASIX stdio metadata by having fd_fdstat_get report stdin’s fs_filetype based on the resolved FD/inode kind (instead of always CharacterDevice), and adds a regression test to ensure piped stdin reports regular-file semantics.
Changes:
- Update
WasiFs::fdstatto compute stdinfs_filetypefrom the resolved FD’s inode kind, with a fallback toCharacterDevice. - Add a WASIX stdio regression test that asserts
fd_fdstat_get(0, ...)reportsRegularFilewhen stdin is piped.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| lib/wasix/src/fs/mod.rs | Changes stdin fdstat filetype reporting to be derived from resolved FD/inode kind rather than hardcoded. |
| lib/wasix/tests/stdio.rs | Adds a regression test module and test that validates stdin piped behavior via fd_fdstat_get. |
Comment on lines
+1830
to
+1837
| let fs_filetype = self | ||
| .get_fd(fd) | ||
| .ok() | ||
| .map(|fd| { | ||
| let guard = fd.inode.read(); | ||
| match guard.deref() { | ||
| Kind::File { .. } | Kind::Buffer { .. } => Filetype::RegularFile, | ||
| Kind::Dir { .. } => Filetype::Directory, |
Comment on lines
+222
to
+227
| fn test_fd_fdstat_get_stdin_pipe_reports_regular_file() { | ||
| #[cfg(not(target_arch = "wasm32"))] | ||
| let runtime = tokio::runtime::Builder::new_multi_thread() | ||
| .enable_all() | ||
| .build() | ||
| .unwrap(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Why