Back to index

glibc  2.9
Functions
tcflush.c File Reference
#include <errno.h>
#include <stddef.h>
#include <termios.h>
#include <unistd.h>
#include "bsdtty.h"
#include <sys/file.h>

Go to the source code of this file.

Functions

int tcflush (int fd, int queue_selector)

Function Documentation

int tcflush ( int  fd,
int  queue_selector 
)

Definition at line 28 of file tcflush.c.

{
  int arg;

  switch (queue_selector)
    {
    case TCIFLUSH:
      arg = FREAD;
      break;
    case TCOFLUSH:
      arg = FWRITE;
      break;
    case TCIOFLUSH:
      arg = FREAD | FWRITE;
      break;
    default:
      __set_errno (EINVAL);
      return -1;
    }

  return __ioctl (fd, TIOCFLUSH, (void *) &arg);
}