tty_port_close_end(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ tty_port_close_end(9) ✨

okay so this is a page from the Kernel API Manual bestie β€” yes, the actual kernel docs, we're going deep today 🫢


πŸ’… NAME

tty_port_close_end β€” the helper for tty->ops->close, and it's literally part 2/2 of the whole situation. the sequel. the second half of the movie 🎬


🌸 SYNOPSIS

void tty_port_close_end (struct tty_port *port , struct tty_struct *tty );

that's it, that's the whole call. two args, no cap ✨


πŸŽ€ ARGUMENTS

  • port β€” the tty_port of the device. the port. the whole point πŸ’–
  • tty β€” the tty that's being closed. yeah. we're closing it. sad but iconic 😭

πŸ¦‹ DESCRIPTION

so this is a continuation of the first part: tty_port_close_start. part 1 gave you the setup, this is the payoff πŸ‘‘

you should call this after turning off the device. it does two big things:

  • it flushes the data from the line discipline 🚿
  • it delays the close by port->close_delay ⏳ (yes, it literally waits, that's the whole vibe)
Locking πŸ”’: the caller holds the tty lock. not optional, not a suggestion β€” you hold it. periodt.

πŸ‘‘ SEE ALSO

the whole tty_port friend group, fr fr β€” and they all live in the kernel file ./drivers/tty/tty_port.c:

like, that's the entire roster. go read them. iykyk πŸ“š


and that's the page bestie!! 🧚 this one's from ./drivers/tty, dated October 2026 β€” so mark your calendar, screenshot it, send it to the group chat, whatever πŸ’œ slay πŸ’…

πŸ“¦ where this page comes from