tty_ldisc_hangup(9)
π tty_ldisc_hangup(9) β Kernel API Manual bestie era π
okay so welcome to tty_ldisc_hangup(9) from the Kernel API Manual β this is the hangup-reset situation, and weβre gonna make it make sense. π«Άβ¨
β¨ NAME β¨
tty_ldisc_hangup β hangup ldisc reset. Thatβs the assignment, and it ate. π
π¦ SYNOPSIS π¦
void tty_ldisc_hangup (struct tty_struct *tty , bool reinit );
π ARGUMENTS π
ttyβ the tty being hung up ππ«Άreinitβ whether to re-initialise the tty β¨
πΈ DESCRIPTION πΈ
Okay so some tty devices reset their termios when they receive a hangup event. In that situation we must also switch back to N_TTY properly before we reset the termios data. Lowkey crucial, no cap. π¦
Locking: We can take the ldisc mutex as the rest of the code is careful to allow for this. ππ
β οΈ In the pty pair case this occurs in the close path of the tty itself, so we must be careful about locking rules. Locking rules are not a vibe to ignore, bestie.
π SEE ALSO π
- Kernel file:
./drivers/tty/tty_ldisc.c
Also the whole SEE ALSO friend group, all iconic, all present: 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_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_setup(9), tty_ldisc_release(9), tty_ldisc_init(9), tty_ldisc_deinit(9). ππ
shoutout to tty_ldisc_hangup(9), the source at ./drivers/tty, the Kernel API Manual version, and the October 2026 date β mwah, 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