Reference

cfmakeraw(3)

set terminal raw mode

NAME

cfmakeraw - set terminal raw mode

LIBRARY

Standard C library (libc, -lc)

SYNOPSIS

#define _DEFAULT_SOURCE  /* See feature_test_macros(7) */
#include <termios.h>

void cfmakeraw(struct termios *termios_p);

DESCRIPTION

cfmakeraw() sets the terminal to something like the "raw" mode of the old Version 7 terminal driver: input is available character by character, echoing is disabled, and all special processing of terminal input and output characters is disabled.

The terminal attributes are set 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;

RETURN VALUE

0

on success.

-1

on failure and set errno to indicate the error.

ATTRIBUTES

For an explanation of the terms used in this section, see attributes(7).

InterfaceAttributeValue
cfmakeraw()Thread safetyMT-Safe

STANDARDS

BSD.

HISTORY

BSD.

SEE ALSO

termios(3type), termios(7)

History