tty_port_close_end(9)
β¨ 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β thetty_portof the device. the port. the whole point πttyβ thettythat'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:
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(9)tty_port_install(9)tty_port_open(9)
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
- 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