---
name: "cfmakeraw"
section: "3"
platform: "linux"
package: "man-pages"
version: "6.19-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux", "freebsd"]
url: "https://new.carta.tech/cfmakeraw"
---

# 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)](/attributes/7.md).

| | | |
| --- | --- | --- |
| **Interface** | **Attribute** | **Value** |
| **cfmakeraw**() | Thread safety | MT-Safe |

## STANDARDS

BSD.

## HISTORY

BSD.

## SEE ALSO

[**termios**(3type)](/termios/3type.md), [**termios**(7)](/termios/7.md)
