Files
esp-idf/components/newlib
Ivan Grokhotkov 3d91e6d993 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-12-21 01:25:49 +00:00
..
2016-08-17 23:08:22 +08:00
2016-08-17 23:08:22 +08:00
2021-01-12 14:05:08 +08:00
2021-11-02 16:24:18 +01:00
2021-06-25 11:48:26 +07:00
2021-11-02 16:24:18 +01:00
2021-01-12 14:05:08 +08:00
2018-09-03 04:39:45 +00:00
2021-01-12 14:05:08 +08:00
2021-11-02 16:24:18 +01:00
2019-07-02 17:17:18 +02:00
2020-11-13 07:49:11 +11:00