tty_ldisc_ref(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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:

iykyk πŸ’œ


ok that's the page!! short king of a manpage fr fr πŸ“ go forth and tty_ldisc_ref responsibly, and remember: flux means NULL means check it πŸ’€

this masterpiece lives in ./drivers/tty and it's dated October 2026 🌸 mwah, bye bestie πŸ’–πŸ§šβ€β™€οΈ

πŸ“¦ where this page comes from