TIOCSLCKTRMIOS(2const)

✨ NAME ✨

TIOCGLCKTRMIOS, TIOCSLCKTRMIOS β€” locking the termios structre πŸ’…

(no bestie that's not a typo I made, that's the typo the page itself is serving, we're keeping it, it's part of the lore now 🫢)


πŸ“š LIBRARY πŸ“š

Standard C library (libc, -lc)


🧚 SYNOPSIS 🧚

#include <asm/termbits.h>  /* Definition of TIOC*CLKTRMIOS constants */
#include <sys/ioctl.h>

int ioctl(int fd, TIOCGLCKTRMIOS, struct termios *argp);
int ioctl(int fd, TIOCSLCKTRMIOS, const struct termios *argp);

#include <asm/termbits.h>

struct termios;

🌸 DESCRIPTION 🌸

Okay so picture this: a terminal has a termios structure, right? And that structure can be locked πŸ”’. The lock is itself a termios structure too β€” and any nonzero bit or field in it means "this value is locked, do not touch, it's giving off-limits energy".

  • TIOCGLCKTRMIOS β€” gets the locking status of the termios structure of the terminal. Basically: "hey bestie, what's locked rn?" πŸ‘€
  • TIOCSLCKTRMIOS β€” sets the locking status of the termios structure of the terminal. And lowkey important: only a process with the CAP_SYS_ADMIN capability can do this. That's a whole admin key, not a vibe you can just walk in with. πŸ‘‘

πŸŽ€ RETURN VALUE πŸŽ€

  • Success? 0 is returned. Iconic. ✨
  • Error? -1 is returned, and errno gets set to tell you what went wrong. πŸ’€

πŸ¦‹ ERRORS πŸ¦‹

  • EPERM β€” insufficient permission. You simply do not have the range, bestie. πŸ™ˆ

πŸ’€ CAVEATS πŸ’€

Please note that struct termios from <asm/termbits.h> is different and incompatible with struct termios from <termios.h>.

Not "kind of different". Incompatible. These two are not the same struct and they are not interchangeable, no cap. And these ioctl calls require struct termios from <asm/termbits.h>. Use the wrong one and you'll be staring at your screen like 😭. The right include is the <asm/termbits.h> one, periodt. πŸ’–


πŸ‘‘ SEE ALSO πŸ‘‘


that's the whole page bestie, go lock some termios (with CAP_SYS_ADMIN tho, fr fr) 🌈

sourced from Linux man-pages 6.20, dated 2026-02-08 β€” cute little timestamp, keep it in your notes πŸ’œ
πŸ“¦ 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-1.0-or-later
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms