nbcon_enter_unsafe(9)
π nbcon_enter_unsafe(9) β like, the Kernel API Manual page, bestie β¨
okay so this is nbcon_enter_unsafe(9), straight out of the Kernel API Manual, and it's genuinely one of those tiny functions that's carrying the whole vibe. let's get into it π«Ά
πΈ NAME πΈ
nbcon_enter_unsafe β enter an unsafe region in the driver, no cap
β¨ SYNOPSIS β¨
bool nbcon_enter_unsafe (struct nbcon_write_context *wctxt );
yes it returns a bool, yes it takes exactly one thing, and yes that one thing matters. keep reading π
π ARGUMENTS π
wctxtβ the write context that was handed to the write function. like, the exact same one you got handed. don't go making your own, bestie, that's not the assignment π
π₯ RETURN π₯
True if this context still owns the console. False if ownership was handed over or taken. that's it, that's the whole drama π
π DESCRIPTION π
okay so here's the thing. when this function returns false, it means the calling context no longer owns the console and is no longer allowed to go forward. periodt. full stop. it's over.
so in that case you must back out immediately and carefully. not "in a sec", not "after I finish this one thing" β immediately. and carefully, because sloppy exits are how you end up with a whole mess π
also, and this is the part people forget: the buffer content is also no longer trusted, since it no longer belongs to the calling context. it's giving "this isn't yours anymore, put it down gently." do not keep reading from it like you still have rights to it, because you do not π
fr fr, false is not a suggestion. it's a leave now.
π¦ SEE ALSO π¦
the whole friend group, in the kernel file ./kernel/printk/nbcon.c:
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_exit_unsafe(9),nbcon_reacquire_nobuf(9),nbcon_emit_next_record(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, you ate that π β¨
and for the cute sign-off: this one lives in ./kernel/printk, dated October 2026, and it's filed under nbcon_enter_unsafe(9) β go be unsafe (in a region) responsibly, bestie ππ¦π
π¦ 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