End of Life Ruby 3.2 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
IO#iflush
io.iflush
ext/io/console/console.c
View on GitHub ↗
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)) sys_fail_fptr(fptr);
#endif
(void)fd;
return io;
}
Flushes input buffer in kernel.
You must require ‘io/console’ to use this method.