tty_port_close(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… tty_port_close(9) β€” Kernel API Manual

okay so bestie, welcome to tty_port_close(9), straight out of the Kernel API Manual ✨ this is the little generic helper that handles the closing side of your tty driver, and honestly it's giving "I'll clean up so you don't have to" main character energy πŸŽ€


✨ NAME ✨

tty_port_close β€” the generic tty->ops->close handler 🫢


🌸 SYNOPSIS 🌸

void tty_port_close (struct tty_port *port , struct tty_struct *tty ,
struct file *filp );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • port β€” the tty_port of the device, your port bestie πŸ’–
  • tty β€” the tty that's being closed, say bye-bye πŸ‘‹
  • filp β€” the file pointer that got passed on through

πŸ‘‘ DESCRIPTION πŸ‘‘

so this is the generic helper you drop into your driver's tty->ops->close, no cap πŸ’… it wraps up a whole little sequence for you: tty_port_close_start, tty_port_shutdown, and tty_port_close_end. so slay.

but here's the important part β€” those last two, tty_port_shutdown and tty_port_close_end, only get called if this is the last close πŸ”₯ like, if there are still other users hanging around, they just don't fire. so if you're curious about the deets, go read the respective functions, iykyk πŸ“–

Locking: the caller holds the tty lock πŸ”’ β€” do not come in here without it, fr fr.

🌈 SEE ALSO 🌈

Kernel file ./drivers/tty/tty_port.c and honestly the whole tty_port friend group πŸ‘‘


and that's the whole page, bestie πŸ§šπŸ’œ this little icon came from ./drivers/tty and the version fairy stamped it October 2026 β€” mwah, periodt πŸ“βœ¨

πŸ“¦ where this page comes from