You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ac...@apache.org on 2026/09/02 12:02:16 UTC
(nuttx) branch master updated (3038df4179f -> 83b4239e1d7)
This is an automated email from the ASF dual-hosted git repository.
acassis pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
from 3038df4179f arch/x86_64: add support for xAPIC
new 60ac52c4b91 sim_hostuart.c: add nonblock flags for /dev/console
new ae666954e6d sim/hostuart: set stdout to O_NONBLOCK to prevent blocking
new 83b4239e1d7 arch/sim: switch nonblock setup to ioctl FIONBIO
The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
arch/sim/src/sim/posix/sim_hostuart.c | 10 ++++++++++
1 file changed, 10 insertions(+)
(nuttx) 01/03: sim_hostuart.c: add nonblock flags for /dev/console
Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit 60ac52c4b9105422638dfacab20fc8f8486832c1
Author: chenzihan1 <ch...@xiaomi.com>
AuthorDate: Wed Aug 20 22:13:30 2025 +0800
sim_hostuart.c: add nonblock flags for /dev/console
to avoid the blocking indefinitely when the host
uart is not ready to read/write data.
Signed-off-by: chenzihan1 <ch...@xiaomi.com>
---
arch/sim/src/sim/posix/sim_hostuart.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/arch/sim/src/sim/posix/sim_hostuart.c b/arch/sim/src/sim/posix/sim_hostuart.c
index 04254bc8828..4976aadd902 100644
--- a/arch/sim/src/sim/posix/sim_hostuart.c
+++ b/arch/sim/src/sim/posix/sim_hostuart.c
@@ -95,6 +95,8 @@ static void restoremode(void)
void host_uart_start(void)
{
+ int flags;
+
/* Get the current stdin terminal mode */
tcgetattr(0, &g_cooked);
@@ -103,6 +105,12 @@ void host_uart_start(void)
setrawmode(0);
+ flags = host_uninterruptible(fcntl, 0, F_GETFL, 0);
+ if (flags > 0)
+ {
+ host_uninterruptible_no_return(fcntl, 0, F_SETFL, flags | O_NONBLOCK);
+ }
+
/* Restore the original terminal mode before exit */
atexit(restoremode);
(nuttx) 02/03: sim/hostuart: set stdout to O_NONBLOCK to prevent blocking
Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit ae666954e6d92559cddb2f74d7678ed5f515ef3d
Author: ligd <li...@xiaomi.com>
AuthorDate: Sat Feb 28 12:11:14 2026 +0800
sim/hostuart: set stdout to O_NONBLOCK to prevent blocking
When NuttX sim is connected via pipe (e.g. by an automation tool),
if the host side does not read stdout in time, the pipe buffer fills
up and write(1, ...) blocks the entire sim process. This happens
inside host_uninterruptible (irq disabled), so the NuttX scheduler
is completely frozen and all threads stop.
Set fd=1 (stdout) to O_NONBLOCK so that write() returns EAGAIN
instead of blocking. The TX data stays in the NuttX xmit buffer
and sim_tty_work retries every 1ms until the pipe has space.
Signed-off-by: ligd <li...@xiaomi.com>
---
arch/sim/src/sim/posix/sim_hostuart.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/arch/sim/src/sim/posix/sim_hostuart.c b/arch/sim/src/sim/posix/sim_hostuart.c
index 4976aadd902..d158e9f794c 100644
--- a/arch/sim/src/sim/posix/sim_hostuart.c
+++ b/arch/sim/src/sim/posix/sim_hostuart.c
@@ -111,6 +111,16 @@ void host_uart_start(void)
host_uninterruptible_no_return(fcntl, 0, F_SETFL, flags | O_NONBLOCK);
}
+ /* Set stdout to non-blocking to prevent write(1, ...) from blocking
+ * the entire sim process when the host pipe buffer is full.
+ */
+
+ flags = host_uninterruptible(fcntl, 1, F_GETFL, 0);
+ if (flags > 0)
+ {
+ host_uninterruptible_no_return(fcntl, 1, F_SETFL, flags | O_NONBLOCK);
+ }
+
/* Restore the original terminal mode before exit */
atexit(restoremode);
(nuttx) 03/03: arch/sim: switch nonblock setup to ioctl FIONBIO
Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit 83b4239e1d780c58ddf55f7533f6ca49dbddba73
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Tue Sep 1 19:47:13 2026 +0800
arch/sim: switch nonblock setup to ioctl FIONBIO
Update host_uart_start() to set stdin/stdout nonblocking via ioctl.
Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
arch/sim/src/sim/posix/sim_hostuart.c | 14 +++-----------
1 file changed, 3 insertions(+), 11 deletions(-)
diff --git a/arch/sim/src/sim/posix/sim_hostuart.c b/arch/sim/src/sim/posix/sim_hostuart.c
index d158e9f794c..a98410393ad 100644
--- a/arch/sim/src/sim/posix/sim_hostuart.c
+++ b/arch/sim/src/sim/posix/sim_hostuart.c
@@ -95,7 +95,7 @@ static void restoremode(void)
void host_uart_start(void)
{
- int flags;
+ int nonblock = 1;
/* Get the current stdin terminal mode */
@@ -105,21 +105,13 @@ void host_uart_start(void)
setrawmode(0);
- flags = host_uninterruptible(fcntl, 0, F_GETFL, 0);
- if (flags > 0)
- {
- host_uninterruptible_no_return(fcntl, 0, F_SETFL, flags | O_NONBLOCK);
- }
+ host_uninterruptible_no_return(ioctl, 0, FIONBIO, &nonblock);
/* Set stdout to non-blocking to prevent write(1, ...) from blocking
* the entire sim process when the host pipe buffer is full.
*/
- flags = host_uninterruptible(fcntl, 1, F_GETFL, 0);
- if (flags > 0)
- {
- host_uninterruptible_no_return(fcntl, 1, F_SETFL, flags | O_NONBLOCK);
- }
+ host_uninterruptible_no_return(ioctl, 1, FIONBIO, &nonblock);
/* Restore the original terminal mode before exit */