tty_set_termios_ldisc(9)
π 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 plainintdoing 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:
tty_register_ldisc(9)tty_unregister_ldisc(9)tty_ldisc_get(9)tty_ldisc_put(9)tty_ldisc_ref_wait(9)tty_ldisc_ref(9)tty_ldisc_deref(9)tty_ldisc_flush(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)
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
- 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