flush_to_ldisc(9)
π flush_to_ldisc(9) β the Kernel API Manual moment π
okay so bestie, we're in the Kernel API Manual and this page is literally about flush_to_ldisc. yes the name is giving exactly what it is. let's go π¦
β¨ NAME β¨
flush_to_ldisc β flush data from buffer to ldisc π
πΈ SYNOPSIS πΈ
void flush_to_ldisc (struct work_struct *work );
like, that's the whole signature. no cap. she's simple, she's iconic π
π ARGUMENTS π
workβ this is the tty structure passed from the work queue. yes queen, it's astruct work_struct *and it's carrying the tty vibes over from the work queue π«Ά
π DESCRIPTION π
so here's the tea: this routine gets called out of the software interrupt to flush data from the buffer chain over to the line discipline. literally moving the data along, main character energy only β¨
the receive_buf method is single threaded for each tty instance. one at a time, no cutting in line, we respect the queue π
Locking: she takes the buffer lock to ensure the single-threaded flip buffer 'consumer' β iykyk, gotta protect that consumer, fr fr π₯
π¦ SEE ALSO π¦
kernel file ./drivers/tty/tty_buffer.c, plus the whole friend group of related calls:
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_flush(9)__tty_buffer_request_room(9)tty_prepare_flip_string(9)tty_ldisc_receive_buf(9)tty_flip_buffer_push(9)tty_insert_flip_string_and_push_buffer(9)tty_buffer_init(9)tty_buffer_set_limit(9)
they're all in ./drivers/tty together, one big happy tty family ππ§
and that's the page bestie, go forth and flush responsibly π
written under ./drivers/tty, dated October 2026, and yeah it's flush_to_ldisc(9) β 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