diff options
Diffstat (limited to 'cpukit/libcsupport')
-rw-r--r-- | cpukit/libcsupport/src/termios.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/cpukit/libcsupport/src/termios.c b/cpukit/libcsupport/src/termios.c index 4586654fdd..1917c68735 100644 --- a/cpukit/libcsupport/src/termios.c +++ b/cpukit/libcsupport/src/termios.c @@ -613,8 +613,13 @@ rtems_termios_ioctl (void *arg) break; #endif case FIONREAD: + { + int rawnc = tty->rawInBuf.Tail - tty->rawInBuf.Head; + if ( rawnc < 0 ) + rawnc += tty->rawInBuf.Size; /* Half guess that this is the right operation */ - *(int *)args->buffer = tty->ccount - tty->cindex; + *(int *)args->buffer = tty->ccount - tty->cindex + rawnc; + } break; } rtems_semaphore_release (tty->osem); |