tty_buffer_flush(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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):


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