for_each_console(9)
πΈ NAME πΈ
okay so this is the for_each_console(9) page from the Kernel API Manual, and the name is literally: Iterator over registered consoles. thatβs the whole vibe: it walks the registered consoles, bestie. π
β¨ SYNOPSIS β¨
hereβs the synopsis, character for character:
for_each_console (con );
π ARGUMENTS π
conβ astruct consolepointer used as the loop cursor. itβs the little βwhere am I rnβ pointer for the loop, iykyk. π¦
π DESCRIPTION π
okay so important thing: the console list and the console.flags are immutable while iterating. no cap, donβt be out here trying to change them mid-loop. π
it also requires console_list_lock to be held. like, that lock is not optional, bestie. π
π real talk: keepconsole_list_lockheld, and remember the console list plusconsole.flagsare immutable while you iterate. thatβs the whole mood.
π¦ SEE ALSO π¦
- Kernel file
./include/linux/console.h struct consw(9)enum cons_flags(9)struct nbcon_state(9)enum nbcon_prio(9)struct nbcon_context(9)struct nbcon_write_context(9)struct console(9)console_srcu_read_flags(9)console_srcu_write_flags(9)for_each_console_srcu(9)
π thatβs the page, bestie β source/version: ./include/linux, date: October 2026. 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