TIOCSETD(2const)

πŸ’… TIOCSETD(2const) πŸ’…

okay bestie, so this is a page from section 2const of the Linux man-pages β€” the little corner of the manual that holds the individual ioctl constants so they each get their own glow-up. sit down, grab a boba, and let's talk about line disciplines ✨


🌸 NAME 🌸

TIOCGETD, TIOCSETD β€” get or set the line discipline of the terminal

like. the whole vibe of this page. one gets, one sets. iconic behavior honestly 🫢


πŸ“š LIBRARY πŸ“š

Standard C library (libc, -lc)

that's the one you already link against, no cap, nothing extra to install πŸŽ€


🧚 SYNOPSIS 🧚

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

int ioctl(int fd, TIOCGETD, int *argp);
int ioctl(int fd, TIOCSETD, const int *argp);

so it's ioctl(2) but make it terminal line discipline. note that TIOCGETD does not take a const on argp and TIOCSETD does. the compiler is watching you πŸ‘€


✨ DESCRIPTION ✨

πŸ¦‹ TIOCGETD

Get the line discipline of the terminal.

like, you're asking the terminal "bestie what's your line discipline rn" and it tells you. lowkey the chill one πŸ’–

πŸ”₯ TIOCSETD

Set the line discipline of the terminal.

and this one is the main character move β€” you're telling the terminal what its line discipline is gonna be now. periodt πŸ’…


πŸŽ€ RETURN VALUE πŸŽ€

On success, 0 is returned. on error? -1 is returned, and errno gets set to tell you exactly what went wrong.

so like β€” 0 = slay, -1 = check errno, it's giving diagnostics 🌈


πŸ‘‘ SEE ALSO πŸ‘‘

go read those next, iykyk ⭐


and that's the whole page bestie!! this one came to you from Linux man-pages 6.20, dated 2026-02-08 β€” treat it like the little treasure it is πŸ’œπŸ’–βœ¨

πŸ“¦ 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