pr_flush(9)
π pr_flush(9) β like, the kernel API manual page, bestie π«Ά
okay so this is pr_flush(9) from the Kernel API Manual (yes, the whole manual is called that, we love a self-titled moment π). Buckle up, it's giving "wait for your slow friends to catch up" energy and honestly? relatable π
β¨ NAME β¨
pr_flush β wait for the printing threads to catch up. that's it. that's the whole vibe. no cap π
π¦ SYNOPSIS π¦
bool pr_flush (int timeout_ms , bool reset_on_progress );
look at her. two args, returns a bool, absolutely iconic β¨
π ARGUMENTS π
timeout_msβ the maximum time to wait, measured in ms. your patience budget, basically β³reset_on_progressβ if this one istrue, the timeout gets reset every time any printer is spotted making some forward progress π like a little "oh wait, they're moving, okay, new timer" situation π₯
πΈ DESCRIPTION πΈ
so here's the tea β:
a value of 0 for timeout_ms means no waiting will occur β zero patience, immediate exit, ghosting behavior fr fr π
a value of -1 represents infinite waiting β she will wait forever, main character commitment energy π
and if reset_on_progress is true, the timeout will be reset whenever any printer has been seen to make some forward progress. lowkey generous of her ngl π«Ά
π§ CONTEXT π§
Process context. she may sleep while acquiring the console lock π΄ like, actual sleeping, not "pretending to be busy" sleeping. respect the nap π
β RETURN β
returns true if all usable printers are caught up. slay. that's the goal. that's the whole point. periodt π
β¨
π₯ SEE ALSO π₯
okay this list is LONG but we do not skip, we do not summarize, we list every single one because that's the rule and we're nothing if not thorough π all of these live in the kernel file ./kernel/printk/printk.c (well, the section header says ./kernel/printk, and it's all printk business, iykyk):
console_list_lock(9)console_list_unlock(9)console_srcu_read_lock(9)console_srcu_read_unlock(9)console_lock_spinning_enable(9)console_lock_spinning_disable_and_check(9)console_trylock_spinning(9)printk_parse_prefix(9)add_preferred_console(9)match_devname_and_update_preferred_console(9)console_suspend_all(9)console_cpu_notify(9)console_lock(9)console_trylock(9)console_unlock(9)console_flush_on_panic(9)printk_kthreads_shutdown(9)console_force_preferred_locked(9)wake_up_klogd(9)defer_console_output(9)printk_trigger_flush(9)printk_timed_ratelimit(9)kmsg_dump_register(9)kmsg_dump_unregister(9)kmsg_dump_desc(9)kmsg_dump_get_line(9)kmsg_dump_get_buffer(9)kmsg_dump_rewind(9)console_try_replay_all(9)__printk_cpu_sync_wait(9)__printk_cpu_sync_try_get(9)__printk_cpu_sync_put(9)
every single one. we ate and left no crumbs π
π‘ friendly reminder bestie:0= no wait,-1= forever, andreset_on_progress= the timer keeps getting a second chance whenever progress happens. don't forget or you'll be debugging at 3am π
and that's the page!! π¦ this little slice of kernel lore comes to you from ./kernel/printk, dated October 2026 β mwah, go read some printk source, ily, 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