cfmakeraw - Man Page
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).
| Interface | Attribute | Value |
|---|---|---|
| cfmakeraw() | Thread safety | MT-Safe |
Standards
BSD.
History
BSD.
See Also
termios(3type), termios(7)
Info
2026-07-02 Linux man-pages 6.20