tty_buffer_flush(9)
π NAME π
okay so bestie, this is tty_buffer_flush(9) from the Kernel API Manual, and it does exactly what it says on the label: flush full tty buffers β¨
πΈ SYNOPSIS πΈ
itβs giving this exact signature, no cap:
void tty_buffer_flush (struct tty_struct *tty , struct tty_ldisc *ld );
π ARGUMENTS π
ttyβ the tty youβre flushing, bestie πldβ optional ldisc ptr, and it must be referenced π
π¦ DESCRIPTION π¦
so this function flushes all the buffers containing receive data. like, every single one holding receive data gets the flush treatment π
if ld != NULL, it flushes the ldisc input buffer too. periodt π
Locking: it takes the buffer lock to ensure a single-threaded flip buffer 'consumer' π no chaotic multi-threaded flip-buffer consumer energy allowed, iykyk.
π SEE ALSO π
the kernel file in question is ./drivers/tty/tty_buffer.c, and hereβs the whole squad of related functions, all iconic, all (9):
tty_buffer_lock_exclusive(9)tty_buffer_unlock_exclusive(9)tty_buffer_space_avail(9)tty_buffer_free_all(9)tty_buffer_alloc(9)tty_buffer_free(9)__tty_buffer_request_room(9)tty_prepare_flip_string(9)tty_ldisc_receive_buf(9)flush_to_ldisc(9)tty_flip_buffer_push(9)tty_insert_flip_string_and_push_buffer(9)tty_buffer_init(9)tty_buffer_set_limit(9)
and thatβs the whole cute little page, bestie π«Ά it lives under ./drivers/tty, the date stamp is October 2026, and the page is literally tty_buffer_flush(9) β slay, bye πβ¨
π¦ 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