tty_set_termios_ldisc(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… tty_set_termios_ldisc(9) β€” kernel API manual, but make it make sense

okay bestie so you found the man page for tty_set_termios_ldisc, and yes the name is a whole mouthful, but stick with me β€” this one's short and honestly kind of iconic in a tiny-little-helper way πŸŽ€


✨ NAME ✨

tty_set_termios_ldisc β€” set ldisc field

that's it. that's the whole job. it sets the ldisc field. main character energy of a function that knows exactly what it is πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

void tty_set_termios_ldisc (struct tty_struct *tty , int disc );

look at her go. void return, two args, no drama 🌸


πŸ“ ARGUMENTS πŸ“

  • tty β€” the tty structure, obvi. this is the thing getting its vibe updated ✨
  • disc β€” the line discipline number. just a plain int doing its little number thing πŸ”’

πŸ’– DESCRIPTION πŸ’–

so here's the tea: this is probably overkill for real-world processors, ngl. but!! they are not on hot paths, so a little discipline won't do any harm 🀭 yes that's the joke, the kernel devs ate with that one and i'm not gonna pretend they didn't 🫢

what it actually does: the line-discipline-related tty_struct fields get reset, so the ldisc driver can't go re-using stale information when it's setting up the new ldisc instance. no leftovers, no crusty old state, we clean the counter before the new customer sits down 😀✨

Locking: takes termios_rwsem πŸ”’ so like, be aware of that before you go waltzing in from somewhere weird, bestie 😭

🌈 SEE ALSO 🌈

kernel file ./drivers/tty/tty_ldisc.c β€” and honestly the whole ldisc friend group showed up, so get comfy:

like i said. the whole group chat πŸ’€ but they're all worth a read, fr fr πŸ“š


and that's a wrap, bestie πŸŽ€ this lil page lives in ./drivers/tty and it's dated October 2026 β€” go forth and set that ldisc field responsibly, ily, mwah πŸ’œπŸ§š

πŸ“¦ where this page comes from