-
Notifications
You must be signed in to change notification settings - Fork 2k
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
stdio_native: initial import #12981
Merged
Merged
stdio_native: initial import #12981
Conversation
This file contains 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
miri64
added
Type: bug
The issue reports a bug / The PR fixes a bug (including spelling errors)
Platform: native
Platform: This PR/issue effects the native platform
Type: new feature
The issue requests / The PR implemements a new feature for RIOT
labels
Dec 18, 2019
miri64
added
Area: cpu
Area: CPU/MCU ports
CI: ready for build
If set, CI server will compile all applications for all available boards for the labeled PR
CI: run tests
If set, CI server will run tests on hardware for the labeled PR
labels
Dec 18, 2019
miri64
force-pushed
the
native/feat/stdio
branch
from
December 18, 2019 11:19
fbd11a5
to
aa16766
Compare
Forgot to push the test 😅 |
miri64
force-pushed
the
native/feat/stdio
branch
from
December 18, 2019 11:22
aa16766
to
539b7bd
Compare
SemjonWilke
approved these changes
Dec 18, 2019
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.
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.
miri64
force-pushed
the
native/feat/stdio
branch
from
December 18, 2019 13:16
539b7bd
to
0957b63
Compare
@aabadie Can we merge? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Area: cpu
Area: CPU/MCU ports
CI: ready for build
If set, CI server will compile all applications for all available boards for the labeled PR
CI: run tests
If set, CI server will run tests on hardware for the labeled PR
Platform: native
Platform: This PR/issue effects the native platform
Type: bug
The issue reports a bug / The PR fixes a bug (including spelling errors)
Type: new feature
The issue requests / The PR implemements a new feature for RIOT
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
stdio
module for native, so the abstraction of stdio is the same as on other boards.While implementing tests for #12975, I noticed, that on
native
when usingvfs
thefmt
print functions would not work. This is because thefmt
module uses thewrite()
system call which is bend by thenative_vfs
module (or thenewlib_syscalls_default
module for real boards) to usevfs_write()
. However, sincenative
doesn't use astdio
module without this PR to print, but just writes to the hosts standard I/O directly, the STDIN, STDOUT, and STDERR are never initialized forvfs
,vfs
fails 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_stdio
will fail onnative
:With
stdio_native
available it will succeed.and
should also still work.
Issues/PRs references
None