tty_kclose(9)
π tty_kclose β Kernel API Manual energy β¨
okay so bestie, welcome to the tty_kclose(9) page from the Kernel API Manual π this one's short and sweet and honestly kinda iconic for how much it does in one line, so let's get into it π
β¨ NAME β¨
tty_kclose β closes a tty that was opened by tty_kopen π«Ά
like, it's the closer. the one who wraps things up. the responsible friend who makes sure the group chat gets home safe π
πΈ SYNOPSIS πΈ
void tty_kclose (struct tty_struct *tty );
that's it. that's the whole vibe check. no cap π§
π¦ ARGUMENTS π¦
ttyβ the tty device π (yes literally, that's the whole description, she's lowkey mysterious like that π)
β DESCRIPTION β
so here's the tea β β tty_kclose performs the final steps to release and free a tty device. it's the last call, the lights-off moment, the "okay everyone say bye" of tty land π
it is the same as tty_release_struct except that it also resets the TTY_PORT_KOPENED flag on tty->port β¨ like yeah it does the same thing as its sibling but she does it with a little extra something β the flag reset is her signature move π
π₯ SEE ALSO π₯
okay so this list is long long, but we don't skip. not on my watch π
first up, the file these all live in: Kernel file ./drivers/tty/tty_io.c π
and now, the whole squad, in order, no one left behind:
free_tty_struct(9)tty_free_file(9)tty_name(9)get_tty_driver(9)tty_dev_name_to_number(9)tty_find_polling_driver(9)tty_wakeup(9)tty_release_redirect(9)__tty_hangup(9)tty_hangup(9)tty_vhangup(9)tty_vhangup_self(9)tty_vhangup_session(9)tty_hung_up_p(9)stop_tty(9)start_tty(9)tty_read(9)tty_write(9)tty_send_xchar(9)pty_line_name(9)tty_line_name(9)tty_driver_lookup_tty(9)tty_init_termios(9)tty_standard_install(9)tty_driver_install_tty(9)tty_driver_remove_tty(9)tty_reopen(9)tty_init_dev(9)tty_save_termios(9)tty_flush_works(9)release_one_tty(9)tty_kref_put(9)release_tty(9)tty_release_checks(9)tty_release_struct(9)tty_release(9)tty_open_current_tty(9)tty_lookup_driver(9)tty_kopen_exclusive(9)tty_kopen_shared(9)tty_open_by_driver(9)tty_open(9)tty_poll(9)tiocsti(9)tiocgwinsz(9)tty_do_resize(9)tiocswinsz(9)tioccons(9)tiocsetd(9)tiocgetd(9)send_break(9)tty_get_tiocm(9)tty_tiocmget(9)tty_tiocmset(9)tty_get_icount(9)alloc_tty_struct(9)tty_put_char(9)tty_register_device(9)tty_register_device_attr(9)tty_unregister_device(9)__tty_alloc_driver(9)tty_driver_kref_put(9)tty_register_driver(9)tty_unregister_driver(9)
likeβ¦ go off, cross-reference section π you ate that fr fr π
π reminder bestie: this one is the kernel-internal close, not your regular userspaceclose(). it's for ttys opened withtty_kopenβ don't be out here closing random stuff and then blaming me π
and that's the whole page, bestie!! π«Ά this lil gem lives under ./drivers/tty and it's dated October 2026 β mwah, go forth and release your ttys responsibly π
π¦ 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