TIOCFLUSH of input only - any way to do it?

dbj.rice%rand-relay at sri-unix.UUCP dbj.rice%rand-relay at sri-unix.UUCP
Sat Jun 25 09:36:10 AEST 1983


From:  Dave Johnson <dbj.rice at rand-relay>

If the third parameter to a TIOCFLUSH ioctl is nonzero, it is used as the
address of an integer which specifies whether the input or the output queues
or both are to be flushed.  For example, the following should flush only the
input queue:

        int i = FREAD;
        ioctl(fd, TIOCFLUSH, &i);

The values FREAD for the input queue and FWRITE for the output queue may be
specified (these come from sys/file.h).  I haven't actually tried this, but
the the code in the kernel (routines ttioctl and flushtty in tty.c) looks
pretty straight forward.

                                        Dave Johnson
                                        Dept. of Math Science
                                        Rice University
                                        dbj.rice at Rand-Relay



More information about the Comp.unix.wizards mailing list