SCP: Use O_NDELAY when putting fd 0 into non blocking mode on Linux
This commit is contained in:
parent
ed081894f8
commit
7f9e60de58
1 changed files with 9 additions and 1 deletions
|
@ -3955,7 +3955,15 @@ static t_stat sim_os_ttinit (void)
|
||||||
sim_debug (DBG_TRC, &sim_con_telnet, "sim_os_ttinit()\n");
|
sim_debug (DBG_TRC, &sim_con_telnet, "sim_os_ttinit()\n");
|
||||||
|
|
||||||
cmdfl = fcntl (fileno (stdin), F_GETFL, 0); /* get old flags and status */
|
cmdfl = fcntl (fileno (stdin), F_GETFL, 0); /* get old flags and status */
|
||||||
runfl = cmdfl | FNDELAY;
|
runfl = cmdfl;
|
||||||
|
/*
|
||||||
|
* make sure systems with broken termios (that don't honor
|
||||||
|
* VMIN=0 and VTIME=0) actually implement non blocking reads.
|
||||||
|
* This will have no negative effect on other systems since
|
||||||
|
* this is turned on and off depending on whether simulation
|
||||||
|
* is running or not.
|
||||||
|
*/
|
||||||
|
runfl = cmdfl | O_NDELAY;
|
||||||
if (!isatty (fileno (stdin))) /* skip if !tty */
|
if (!isatty (fileno (stdin))) /* skip if !tty */
|
||||||
return SCPE_OK;
|
return SCPE_OK;
|
||||||
if (tcgetattr (0, &cmdtty) < 0) /* get old flags */
|
if (tcgetattr (0, &cmdtty) < 0) /* get old flags */
|
||||||
|
|
Loading…
Add table
Reference in a new issue