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 is a pointer to a termios structure. This structure 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, zero is returned. On failure, -1 is returned, and errno is set appropriately.