nbcon_emit_next_record(9)
π nbcon_emit_next_record(9) β from the Kernel API Manual, bestie π
okay so picture this: you're holding the console, the console is yours, and now you gotta actually emit a record in the context you already acquired. That's the whole vibe of nbcon_emit_next_record(9), straight out of the Kernel API Manual. Let's get into it π
β¨ SYNOPSIS β¨
bool nbcon_emit_next_record (struct nbcon_write_context *wctxt , bool
use_atomic );
π«Ά ARGUMENTS π«Ά
wctxtβ the write context, aka the thing that gets handed off to the write function. it's giving "delivery driver, here's the package" π¦use_atomicβtrueif you want thewrite_atomiccallback to be the one doing the work
β RETURN β
Returns true if this context still owns the console. Returns false if ownership was handed over or taken β like, stolen, lowkey π
π DESCRIPTION π
okay so here's the important part, bestie, listen up:
When this function returns false, the calling context no longer owns the console and is literally not allowed to keep going. Not even a little. In that case it has to back out immediately and carefully β no cap, carefully. The buffer content is also no longer trusted, because it doesn't belong to the calling context anymore. So if you're the caller and you want to do more stuff? You gotta reacquire the console first. Periodt. π
When true is returned, wctxt->ctxt.backlog tells you whether there are still records pending in the ringbuffer. it's your little status check πΈ
β οΈ real talk: false means hands off. don't touch the buffer, don't keep writing, just exit gracefully and reacquire. the console said "not yours anymore" and we respect the console π
π SEE ALSO π
the whole friend group, fr fr β kernel file ./kernel/printk/nbcon.c, plus:
nbcon_state_set(9)nbcon_state_read(9)nbcon_state_try_cmpxchg(9)nbcon_seq_read(9)nbcon_seq_force(9)nbcon_seq_try_update(9)nbcon_context_try_acquire_direct(9)nbcon_context_try_acquire_requested(9)nbcon_context_try_acquire_handover(9)nbcon_context_try_acquire_hostile(9)nbcon_context_try_acquire(9)nbcon_context_release(9)nbcon_context_can_proceed(9)nbcon_can_proceed(9)__nbcon_context_update_unsafe(9)nbcon_enter_unsafe(9)nbcon_exit_unsafe(9)nbcon_reacquire_nobuf(9)nbcon_kthread_should_wakeup(9)nbcon_kthread_func(9)nbcon_irq_work(9)nbcon_kthreads_wake(9)nbcon_kthread_create(9)nbcon_get_cpu_emergency_nesting(9)nbcon_get_default_prio(9)nbcon_allow_unsafe_takeover(9)nbcon_legacy_emit_next_record(9)__nbcon_atomic_flush_pending_con(9)nbcon_atomic_flush_pending_con(9)__nbcon_atomic_flush_pending(9)nbcon_atomic_flush_pending(9)nbcon_atomic_flush_unsafe(9)nbcon_cpu_emergency_enter(9)nbcon_cpu_emergency_exit(9)nbcon_alloc(9)nbcon_free(9)nbcon_device_try_acquire(9)nbcon_device_release(9)nbcon_kdb_try_acquire(9)nbcon_kdb_release(9)nbcon_write_context_is_braille(9)nbcon_braille_try_acquire(9)nbcon_braille_release(9)
okay that's the whole page!! π¦ this gem lives over in ./kernel/printk, dated October 2026 β she's from the future and she's iconic for it πβ¨ mwah, go emit some records responsibly π
π¦ 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