Method: IO#iflush
- Defined in:
- console/console.c
#iflush ⇒ Object
Flushes input buffer in kernel.
You must require ‘io/console’ to use this method.
581 582 583 584 585 586 587 588 589 590 591 592 593 594 |
# File 'console/console.c', line 581
static VALUE
console_iflush(VALUE io)
{
rb_io_t *fptr;
int fd;
GetOpenFile(io, fptr);
fd = GetReadFD(fptr);
#if defined HAVE_TERMIOS_H || defined HAVE_TERMIO_H
if (tcflush(fd, TCIFLUSH)) rb_sys_fail(0);
#endif
(void)fd;
return io;
}
|