FIONREAD(2const) FIONREAD(2const)

FIONREAD, TIOCINQ, TIOCOUTQ, TCFLSH, TIOCSERGETLSR - buffer count and flushing

Standard C library (libc, -lc)

#include <asm/termbits.h>  /* Definition of constants */
#include <sys/ioctl.h>
int ioctl(int fd, FIONREAD, int *argp);
int ioctl(int fd, TIOCINQ, int *argp);
int ioctl(int fd, TIOCOUTQ, int *argp);
int ioctl(int fd, TCFLSH, int arg);
int ioctl(int fd, FIONREAD, int *argp);

Get the number of bytes in the input buffer.
Same as FIONREAD.
Get the number of bytes in the output buffer.
Equivalent to tcflush(fd, arg).
See tcflush(3) for the argument values TCIFLUSH, TCOFLUSH, TCIOFLUSH.
Get line status register. Status register has TIOCSER_TEMT bit set when output buffer is empty and also hardware transmitter is physically empty.
Does not have to be supported by all serial tty drivers.
tcdrain(3) does not wait and returns immediately when TIOCSER_TEMT bit is set.

On success, 0 is returned. On error, -1 is returned, and errno is set to indicate the error.

ioctl(2), ioctl_tty(2), tcflush(3), termios(3)

2024-06-13 Linux man-pages 6.9.1