tty_ldisc_reinit(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ NAME ✨

okay so welcome to the Kernel API Manual, bestie β€” this page is highkey all about tty_ldisc_reinit, aka reinitialise the tty ldisc, and it's literally the β€œclose the old instance, open a new one” reset moment for your line discipline πŸ’…βœ¨

🌸 SYNOPSIS 🌸

int tty_ldisc_reinit (struct tty_struct *tty , int disc );

πŸŽ€ ARGUMENTS πŸŽ€

  • tty β€” the tty to reinit, periodt. That's the one getting the glow-up 🫢
  • disc β€” the line discipline to reinitialize. Yes, that exact one, bestie.

πŸ’– DESCRIPTION πŸ’–

The way this function completely reinitializes the line discipline state? Obsessed. It closes the current instance β€” if there is one β€” and opens a new instance, fr fr. Main character energy, ngl ✨

If an error occurs opening the new non-N_TTY instance, that instance is dropped and tty->ldisc gets reset to NULL. The caller can then retry with N_TTY instead, iykyk πŸ˜­πŸ’…

πŸ”₯ RETURN πŸ”₯

  • 0 if successful β€” slay βœ…
  • otherwise, an error code < 0 β€” not slay, but at least you know πŸ’€

πŸ¦‹ SEE ALSO πŸ¦‹

Kernel file: ./drivers/tty/tty_ldisc.c. Go give these icons a vibe check too:

That's the whole Kernel API Manual page, freshly shipped from ./drivers/tty in October 2026 β€” bye bestie, mwah πŸ«ΆπŸŽ€βœ¨

πŸ“¦ where this page comes from