TIOCSTI(2const)
β¨ TIOCSTI β¨
okay so bestie, welcome to the TIOCSTI page π it lives in the 2const section of the manual (that's the const-y corner of section 2, iykyk), and it's literally all about faking input. yes fr fr, you can just. shove a byte into a terminal's input queue like you're typing it yourself. main character energy π
π LIBRARY
Standard C library (libc, -lc) π«Ά
πΈ SYNOPSIS
#include <asm/termbits.h> /* Definition of TIOCSTI */
#include <sys/ioctl.h>
int ioctl(int fd, TIOCSTI, const char *argp);
π DESCRIPTION
So what it does: insert the given byte in the input queue. that's it, that's the whole vibe. one byte, straight into the queue, like it came from the keyboard itself π
β οΈ okay but heads up, because since Linux 6.2 this operation may require theCAP_SYS_ADMINcapability β and that only kicks in if thedev.tty.legacy_tiocstisysctl variable is set tofalse. so if it's giving permission-denied, that's why bestie π
π«Ά RETURN VALUE
- On success,
0is returned β¨ - On error,
-1is returned, anderrnois set to indicate the error π
π₯ ERRORS
EPERMβ Insufficient permission. that's the one, that's the whole list, no cap π
π SEE ALSO
π and that's the page!! this one came from Linux man-pages 6.20, dated 2026-02-08 β so if you're reading it later, don't come for me, come for the man-pages maintainers π§ slay, bye bestie! πβ
π¦ 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