tty_ldisc_ref(9)
π tty_ldisc_ref(9) β the kernel API manual, bestie edition
okay so welcome to tty_ldisc_ref(9) from the Kernel API Manual β¨ this one's short and sweet, but it's lowkey important, so pay attention π«Ά
πΈ NAME πΈ
tty_ldisc_ref β get the tty ldisc π
π SYNOPSIS π
struct tty_ldisc * tty_ldisc_ref (struct tty_struct *tty );
like look at that signature. immaculate. no cap π
π¦ ARGUMENTS π¦
ttyβ the tty device, bestie. that's the whole argument. one (1) tty device, and it's yours π
β¨ DESCRIPTION β¨
so what does it actually do? it dereferences the line discipline for the terminal and takes a reference to it. very demure, very mindful π
and then β this is the part you need to know β if the line discipline is in flux then it returns NULL. so like... check for NULL, okay? don't be out here dereferencing a maybe-nothing, i'm begging π
the good news? it can be called from IRQ and timer functions π so you're safe in interrupt context, slay.
π₯ SEE ALSO π₯
kernel file ./drivers/tty/tty_ldisc.c β and literally the whole ldisc friend group, they all showed up:
tty_register_ldisc(9)tty_unregister_ldisc(9)tty_ldisc_get(9)tty_ldisc_put(9)tty_ldisc_ref_wait(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)
iykyk π
ok that's the page!! short king of a manpage fr fr π go forth andtty_ldisc_refresponsibly, and remember: flux meansNULLmeans check it π
this masterpiece lives in ./drivers/tty and it's dated October 2026 πΈ mwah, bye bestie ππ§ββοΈ
π¦ 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