cfmakeraw

Name

cfmakeraw -- get and set terminal attributes

Synopsis

#include <termios.h>

int cfmakeraw(struct termios *termios_p);

Description

cfmakeraw sets the terminal attributes as follows:
  termios_p->c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP
                          |INLCR|IGNCR|ICRNL|IXON);

  termios_p->c_oflag &= ~OPOST;

  termios_p->c_lflag &= ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN);

  termios_p->c_cflag &= ~(CSIZE|PARENB);

  termios_p->c_cflag |= CS8;

termios_p points to a termios structure that contains the following members:
  tcflag_t c_iflag;      /* input modes */
  tcflag_t c_oflag;      /* output modes */
  tcflag_t c_cflag;      /* control modes */
  tcflag_t c_lflag;      /* local modes */
  cc_t c_cc[NCCS];       /* control chars */

Return Value

On success, 0 is returned. On error, -1 is returned and the global variable errno is set appropriately.