TIOCTTYGSTRUCT(2const)
β¨ TIOCTTYGSTRUCT β¨
okay so bestie, welcome to TIOCTTYGSTRUCT(2const) β yes that's the man page name, it's giving Very Long Acronym, and it lives in section 2const of the Linux man-pages π
πΈ NAME πΈ
TIOCTTYGSTRUCT β kernel debugging π€
no fr, that's literally the whole job description. it's a debugging thing. an icon of "we needed this once, in the before times."
π«Ά LIBRARY π«Ά
Standard C library (libc, -lc)
so like, link with -lc and you're good, that's the plain vanilla libc, no fancy extras needed π
π SYNOPSIS π
#include <sys/ioctl.h>
int ioctl(int fd, TIOCTTYGSTRUCT, struct tty_struct *argp);
#include <linux/tty.h>
struct tty_struct;
so you're calling ioctl() with your file descriptor fd, the request TIOCTTYGSTRUCT, and argp, which is a pointer to a struct tty_struct π
and yeah, struct tty_struct is just forward-declared β the page literally says:
struct tty_struct;
that's it, that's the struct, it's giving "mystery, intrigue, we're not telling you the fields" β¨
π¦ DESCRIPTION π¦
Get the tty_struct corresponding to fd.
that's the whole thing. you hand it a file descriptor, it hands you back the tty_struct that goes with it. lowkey straightforward, highkey ancient π
π RETURN VALUE π
- On success,
0is returned π - On error,
-1is returned, anderrnois set to indicate the error π
classic ioctl behaviour, no surprises there, bestie π
π HISTORY π
This operation was removed in Linux 2.5.67. π
not deprecated. not "discouraged". REMOVED. gone. this is a historical artefact, a museum piece, do not go looking for it on a modern kernel, it will not be there, periodt π
π SEE ALSO π
mwah that's the whole page, bestie π«Ά this rewrite came to you courtesy of Linux man-pages 6.20, dated 2026-02-08 β so go forth, know your ancient kernel-debugging ioctls, and remember: if you ever actually need TIOCTTYGSTRUCT, you are probably time travelling π§β¨
π¦ 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