Back to index

glibc  2.9
Functions
tcflow.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.

Functions

int tcflow (int fd, int action)

Function Documentation

int tcflow ( int  fd,
int  action 
)

Definition at line 28 of file tcflow.c.

{
  switch (action)
    {
    case TCOOFF:
      return __ioctl (fd, TIOCSTOP, (void *) NULL);
    case TCOON:
      return __ioctl (fd, TIOCSTART, (void *) NULL);

    case TCIOFF:
    case TCION:
      {
       /* This just writes the START or STOP character with
          `write'.  Is there another way to do this?  */
       struct termios attr;
       unsigned char c;
       if (tcgetattr (fd, &attr) < 0)
         return -1;
       c = attr.c_cc[action == TCIOFF ? VSTOP : VSTART];
       if (c != _POSIX_VDISABLE && write (fd, &c, 1) < 1)
         return -1;
       return 0;
      }

    default:
      __set_errno (EINVAL);
      return -1;
    }
}

Here is the call graph for this function: