tty_ldisc_get(9)
π 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 β
-EINVALif the discipline index is not[N_TTY .. NR_LDISCS]or if the discipline is not registered.-EAGAINifrequest_modulefailed to load or register the discipline.-ENOMEMif 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:
tty_register_ldisc(9)tty_unregister_ldisc(9)tty_ldisc_put(9)tty_ldisc_ref_wait(9)tty_ldisc_ref(9)tty_ldisc_deref(9)tty_ldisc_flush(9)tty_set_termios_ldisc(9)tty_ldisc_open(9)tty_ldisc_close(9)tty_ldisc_failto(9)tty_ldisc_restore(9)tty_set_ldisc(9)tty_ldisc_kill(9)tty_reset_termios(9)tty_ldisc_reinit(9)tty_ldisc_hangup(9)tty_ldisc_setup(9)tty_ldisc_release(9)tty_ldisc_init(9)tty_ldisc_deinit(9)
π
source/version: ./drivers/tty Β· date: October 2026 Β· bye bestie, go take that reference responsibly π«Ά
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms