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 thetermiosstructure of the terminal. Basically: "hey bestie, what's locked rn?" πTIOCSLCKTRMIOSβ sets the locking status of thetermiosstructure of the terminal. And lowkey important: only a process with theCAP_SYS_ADMINcapability can do this. That's a whole admin key, not a vibe you can just walk in with. π
π RETURN VALUE π
- Success?
0is returned. Iconic. β¨ - Error?
-1is returned, anderrnogets set to tell you what went wrong. π
π¦ ERRORS π¦
EPERMβ insufficient permission. You simply do not have the range, bestie. π
π CAVEATS π
Please note thatstruct termiosfrom<asm/termbits.h>is different and incompatible withstruct termiosfrom<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
- Copyright 2002, Walter Harms <walter.harms@informatik.uni-oldenburg.de>
- Copyright 2002, Andries E. Brouwer <aeb@cwi.nl>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms