xiaoxiang781216 commented on code in PR #20028:
URL: https://github.com/apache/nuttx/pull/20028#discussion_r3904260482
##########
arch/sim/src/sim/sim_uart.c:
##########
@@ -622,7 +622,12 @@ static void tty_dmareceive(struct uart_dev_s *dev)
{
xfer->nbytes = ret;
- if (ret == xfer->length && xfer->nlength > 0)
+ /* The console fd is blocking, so only continue into the wrapped
Review Comment:
> `uart_nputs()` won't work well with it. Simulated uarts never execute this
path, sim console fd is always forced to host fd=0.
>
> Another thing is that we will change default host fd 0 setting (we have to
call ` fcntl(0, F_SETFL, O_NONBLOCK)` )
yes, here is the change: https://github.com/apache/nuttx/pull/20032
we use internally more than half year without problem.
> which we should recover after nuttx simulator is closed or crash.
why need? non-block is the property of file handle, not the terminal.
>
> This fix is a one-line fix, changing it to NONBLOCK is a rebuild of how
the sim console works.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]