esp-idf/components/newlib
Ivan Grokhotkov 5da66d1d39 newlib: implement _fstat_r stub for console
When CONFIG_VFS_SUPPORT_IO is disabled, _read_r and _write_r
implementations in syscalls.c are used to provide console I/O via
esp_rom_uart_tx_one_char/esp_rom_uart_rx_one_char.

When newlib opens a (FILE*) stream, it calls fstat to check if the
underlying file is character-oriented. In this case, it configures the
stream to use line buffering. Otherwise (or if fstat fails) the stream
is opened as block buffered.

Since fstat wasn't provided, stdin/stdout/stderr streams got opened in
block buffered mode. For console, we need line buffered output so that
the stream buffer is flushed each time a complete line (ending with
'\n') is sent to stdout or stderr.

Fix by implementing _fstat_r stub, setting st->st_mdoe=S_IFCHR.
2021-09-16 09:00:07 +02:00
..
platform_include newlib: Override __assert and __assert_func 2021-08-05 11:09:22 +05:30
port esp32h2: enable more components to support esp32h2 2021-07-01 19:53:11 +08:00
priv_include Whitespace: Automated whitespace fixes (large commit) 2020-11-11 07:36:35 +00:00
test tests: refactoring of the gcc's inner functions, because clang doesn't support them 2021-09-10 19:51:27 +03:00
test_apps CI: minor testcases fixes and disable some cases that cant run on S3 2021-06-15 13:39:48 +08:00
.gitignore Initial public version 2016-08-17 23:08:22 +08:00
.gitmodules Initial public version 2016-08-17 23:08:22 +08:00
abort.c global: fix sign-compare warnings 2021-01-12 14:05:08 +08:00
assert.c newlib: Override __assert and __assert_func 2021-08-05 11:09:22 +05:30
CMakeLists.txt newlib: Override __assert and __assert_func 2021-08-05 11:09:22 +05:30
component.mk newlib: Override __assert and __assert_func 2021-08-05 11:09:22 +05:30
COPYING.NEWLIB Whitespace: Automated whitespace fixes (large commit) 2020-11-11 07:36:35 +00:00
esp32-spiram-rom-functions-c.lf psram: add configuration macros to move workaround libc functions to flash 2021-06-23 17:40:02 +08:00
heap.c tests: re-add all disabled tests and all disabled configurations 2020-10-14 16:11:49 +11:00
Kconfig Rename Kconfig options (components/esp32) 2019-05-21 09:09:01 +02:00
locks.c esp32h2: enable more components to support esp32h2 2021-07-01 19:53:11 +08:00
Makefile.old Whitespace: Automated whitespace fixes (large commit) 2020-11-11 07:36:35 +00:00
newlib_init.c esp32h2: enable more components to support esp32h2 2021-07-01 19:53:11 +08:00
newlib.lf newlib: Override __assert and __assert_func 2021-08-05 11:09:22 +05:30
poll.c global: fix sign-compare warnings 2021-01-12 14:05:08 +08:00
pthread.c Whitespace: Automated whitespace fixes (large commit) 2020-11-11 07:36:35 +00:00
random.c esp32: Add esp_fill_random() function 2018-09-03 04:39:45 +00:00
reent_init.c global: fix sign-compare warnings 2021-01-12 14:05:08 +08:00
stdatomic.c newlib,clang: implement __sync_* atomics for clang/llvm toolchain. 2021-07-15 20:36:40 +03:00
syscalls.c newlib: implement _fstat_r stub for console 2021-09-16 09:00:07 +02:00
system_libs.lf esp32: move system libs 2021-03-31 19:17:33 +08:00
termios.c VFS: Fix Kconfig prefix 2019-07-02 17:17:18 +02:00
time.c Updates for riscv support 2020-11-13 07:49:11 +11:00