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 the CAP_SYS_ADMIN capability β€” and that only kicks in if the dev.tty.legacy_tiocsti sysctl variable is set to false. so if it's giving permission-denied, that's why bestie πŸ™ˆ

🫢 RETURN VALUE

  • On success, 0 is returned ✨
  • On error, -1 is returned, and errno is 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
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms