Merged
Conversation
fbd11a5 to
aa16766
Compare
Member
Author
|
Forgot to push the test 😅 |
aa16766 to
539b7bd
Compare
ghost
approved these changes
Dec 18, 2019
ghost
left a comment
There was a problem hiding this comment.
ACK
test works as explained
PR is very reasonable
code looks good
aabadie
reviewed
Dec 18, 2019
On `native` when using `vfs` the `fmt` print functions do not work. This is because the `fmt` module uses the `write()` system call which is bend by the `native_vfs` module to use `vfs_write()`. However, `native` does not use a `stdio` module to print. Instead, it just writes to the hosts standard I/O directly. As such, STDIN, STDOUT, and STDERR are never initialized for `vfs` so `vfs` does not recognize `STDIN_FILENO`, `STDOUT_FILENO` and `STDERR_FILENO` as valid file descriptors. This test case showcases this bug.
539b7bd to
0957b63
Compare
Member
Author
|
@aabadie Can we merge? |
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.
Contribution description
This provides a
stdiomodule for native, so the abstraction of stdio is the same as on other boards.While implementing tests for #12975, I noticed, that on
nativewhen usingvfsthefmtprint functions would not work. This is because thefmtmodule uses thewrite()system call which is bend by thenative_vfsmodule (or thenewlib_syscalls_defaultmodule for real boards) to usevfs_write(). However, sincenativedoesn't use astdiomodule without this PR to print, but just writes to the hosts standard I/O directly, the STDIN, STDOUT, and STDERR are never initialized forvfs,vfsfails here:RIOT/sys/vfs/vfs.c
Lines 320 to 323 in 33b1f9e
Testing procedure
Without
stdio_native(revert all commits related to it; the HEAD when opening), the provided test applicationtests/vfs_and_stdiowill fail onnative:With
stdio_nativeavailable it will succeed.and
should also still work.
Issues/PRs references
None