cfmakeraw(3) Library Functions Manual cfmakeraw(3)

cfmakeraw - set terminal raw mode

Standard C library (libc-lc)

#define _DEFAULT_SOURCE  /* See feature_test_macros(7) */
#include <termios.h>
void cfmakeraw(struct termios *termios_p);

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;

0
on success.
-1
on failure and set errno to indicate the error.

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

Interface Attribute Value
cfmakeraw () Thread safety MT-Safe

BSD.

BSD.

termios(3type), termios(7)

2026-07-02 Linux man-pages 6.19