tty_ldisc_get(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– tty_ldisc_get(9) β€” Kernel API Manual πŸ’–

okay bestie, welcome to the kernel API manual for tty_ldisc_get(9) β€” it's giving β€œgrab a reference to an ldisc” energy, and we're gonna get through it together πŸ’…


✨ NAME ✨

tty_ldisc_get β€” take a reference to an ldisc. periodt.


🌸 SYNOPSIS 🌸

struct tty_ldisc * tty_ldisc_get (struct tty_struct *tty , int disc );

πŸŽ€ ARGUMENTS πŸŽ€

  • tty β€” the tty device, bestie.
  • disc β€” the ldisc number. yes, that's the whole vibe.

πŸ¦‹ DESCRIPTION πŸ¦‹

so this function takes a reference to a line discipline. it deals with refcounts and module locking counts. if the discipline is not available, its module gets loaded, if possible. no cap.

Locking: it takes tty_ldiscs_lock to guard against ldisc races. iconic behavior, honestly.


⭐ RETURN ⭐

  • -EINVAL if the discipline index is not [N_TTY .. NR_LDISCS] or if the discipline is not registered.
  • -EAGAIN if request_module failed to load or register the discipline.
  • -ENOMEM if allocation failure. 😭
  • Otherwise, it returns a pointer to the discipline and bumps the ref count. slay.

🌈 SEE ALSO 🌈

Kernel file: ./drivers/tty/tty_ldisc.c β€” and here are all the linked besties:


πŸ’… source/version: ./drivers/tty Β· date: October 2026 Β· bye bestie, go take that reference responsibly 🫢

πŸ“¦ where this page comes from