Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions arch/sim/src/sim/posix/sim_hostuart.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ static void restoremode(void)

void host_uart_start(void)
{
int nonblock = 1;

/* Get the current stdin terminal mode */

tcgetattr(0, &g_cooked);
Expand All @@ -103,6 +105,14 @@ void host_uart_start(void)

setrawmode(0);

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.
*/

host_uninterruptible_no_return(ioctl, 1, FIONBIO, &nonblock);

/* Restore the original terminal mode before exit */

atexit(restoremode);
Expand Down
Loading