tty_ldisc_hangup(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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