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 sets errno to 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
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms