Back to index

glibc  2.9
tcdrain.c File Reference
#include <errno.h>
#include <stddef.h>
#include <termios.h>
#include <unistd.h>
#include "bsdtty.h"

Go to the source code of this file.


int __libc_tcdrain (int fd)

Function Documentation

Definition at line 28 of file tcdrain.c.

  /* The TIOCSETP control waits for pending output to be written before
     affecting its changes, so we use that without changing anything.  */
  struct sgttyb b;
  if (__ioctl (fd, TIOCGETP, (void *) &b) < 0 ||
      __ioctl (fd, TIOCSETP, (void *) &b) < 0)
    return -1;
  return 0;