We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I suggest to change the order of the creation of the standard streams in cpu_start:
current order: _GLOBAL_REENT->_stdout = fopen(default_uart_dev, "w"); _GLOBAL_REENT->_stderr = fopen(default_uart_dev, "w"); _GLOBAL_REENT->_stdin = fopen(default_uart_dev, "r");
proposed order: _GLOBAL_REENT->_stdin = fopen(default_uart_dev, "r"); _GLOBAL_REENT->_stdout = fopen(default_uart_dev, "w"); _GLOBAL_REENT->_stderr = fopen(default_uart_dev, "w");
The thing is that with the current order the correspondence between standard streams and standards file descriptors are incorrect:
_stdout has file descriptor 0 _stderr has file descriptor 1 _stdin has file descriptor 2
and the correct file descriptors are:
_stdin has file descriptor 0 _stdout has file descriptor 1 _stderr has file descriptor 2
In posix-compliance code this will be a problem wen using functions that work with file descriptors, such as write, for example:
write(STDOUT_FILENO, "hello world", 11)
will out to STDERR.
The text was updated successfully, but these errors were encountered:
fix order of creation of standard streams
6dd3681
With existing order, file descriptors assigned to stdin, stdout, stderr didn't match standard assignment. #67
Fixed master
Sorry, something went wrong.
Merge branch 'bugfix/msys_cancel_idfpy' into 'master'
de7daa1
tools: re-run idf.py in MSYS with winpty Closes #67 See merge request idf/esp-idf!4341
Cmpctmalloc: Use C-style asterisk placement consistently (espressif#67)
90ed5db
igrr
No branches or pull requests
I suggest to change the order of the creation of the standard streams in cpu_start:
current order:
_GLOBAL_REENT->_stdout = fopen(default_uart_dev, "w");
_GLOBAL_REENT->_stderr = fopen(default_uart_dev, "w");
_GLOBAL_REENT->_stdin = fopen(default_uart_dev, "r");
proposed order:
_GLOBAL_REENT->_stdin = fopen(default_uart_dev, "r");
_GLOBAL_REENT->_stdout = fopen(default_uart_dev, "w");
_GLOBAL_REENT->_stderr = fopen(default_uart_dev, "w");
The thing is that with the current order the correspondence between standard streams and standards file descriptors are incorrect:
_stdout has file descriptor 0
_stderr has file descriptor 1
_stdin has file descriptor 2
and the correct file descriptors are:
_stdin has file descriptor 0
_stdout has file descriptor 1
_stderr has file descriptor 2
In posix-compliance code this will be a problem wen using functions that work with file descriptors, such as write, for example:
write(STDOUT_FILENO, "hello world", 11)
will out to STDERR.
The text was updated successfully, but these errors were encountered: