tty_port_close(9)
π 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β thetty_portof the device, your port bestie πttyβ thettythat'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 π
tty_port_init(9)tty_port_link_wq(9)tty_port_link_device(9)tty_port_register_device(9)tty_port_register_device_attr(9)tty_port_register_device_attr_serdev(9)tty_port_unregister_device(9)tty_port_destroy(9)tty_port_put(9)tty_port_tty_get(9)tty_port_tty_set(9)tty_port_shutdown(9)tty_port_hangup(9)tty_port_tty_hangup(9)tty_port_tty_vhangup(9)tty_port_tty_wakeup(9)tty_port_carrier_raised(9)tty_port_raise_dtr_rts(9)tty_port_lower_dtr_rts(9)tty_port_block_til_ready(9)tty_port_close_start(9)tty_port_close_end(9)tty_port_install(9)tty_port_open(9)
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
- 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