cfmakeraw(3)
π 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 πΈ
okay bestie, listen. cfmakeraw() takes your terminal and sets it to something like the "raw" mode from the old Version 7 terminal driver. it's giving vintage, it's giving OG. π°οΈβ¨
what does raw actually mean tho? three things, and they're all kinda unhinged:
- input shows up character by character β no more waiting around for a whole line like it's buffering your texts
- echoing is disabled β you type, it doesn't type back at you π
- all special processing of terminal input and output characters is disabled β the terminal stops being a little control freak about your keystrokes
and here's exactly what it does to your termios struct, no cap:
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;
like i said. it's clearing flags left and right. iconic behavior, honestly. π
π₯ RETURN VALUE π₯
0β on success. slay, we love a win. π-1β on failure, and it setserrnoto indicate the error. sad girl hours π
π ATTRIBUTES π
for an explanation of the terms used in this section, go check attributes(7) fr fr.
cfmakeraw()β Thread safety: MT-Safe
π STANDARDS π
BSD.
π¦ HISTORY π¦
BSD. (yes, again. it's old money, bestie. β¨)
π«Ά SEE ALSO π«Ά
that's the whole page, babe β brought to you by Linux man-pages 6.20, dated 2026-07-02. mwah, go write something cursed with raw mode π
π¦ where this page comes from
- arch rolling: man-pages 6.20-1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
- nixpkgs unstable: man-pages 6.20
- π the page's license: GPL-2.0-or-later
- Copyright 2006-2015, Michael Kerrisk <mtk.manpages@gmail.com>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms