STRUCT NBCON_WRITE_CONTEXT(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– struct nbcon_write_context(9) πŸ’–

okay so bestie, welcome to the Kernel API Manual β€” this page is literally all about the context handed to the nbcon write callbacks, and it is lowkey iconic. let's get into it πŸ’…βœ¨


🌟 NAME 🌟

struct nbcon_write_context β€” Context handed to the nbcon write callbacks 🫢


✨ SYNOPSIS ✨

struct nbcon_write_context {
    struct nbcon_context    ctxt;
    char *outbuf;
    unsigned int            len;
    bool unsafe_takeover;
  #ifdef CONFIG_PRINTK_EXECUTION_CTX;
    int cpu;
    pid_t pid;
    char comm[TASK_COMM_LEN];
  #endif;
 };

🫢 Members 🫢

the way this struct has layers, fr fr 😭 the cpu, pid, and comm members are sitting inside the #ifdef CONFIG_PRINTK_EXECUTION_CTX block up in the synopsis β€” don't forget the conditional, bestie πŸ’–

  • ctxt β€” The core console context πŸ‘‘
  • outbuf β€” Pointer to the text buffer for output ✨
  • len β€” Length to write πŸ“
  • unsafe_takeover β€” If a hostile takeover in an unsafe state has occurred πŸ˜­πŸ’€
  • cpu β€” CPU on which the message was generated πŸ–₯️
  • pid β€” PID of the task that generated the message 🧚
  • comm β€” Name of the task that generated the message 🏷️

🌈 SEE ALSO 🌈

Kernel file ./include/linux/console.h:


this cutie is from ./include/linux, dated October 2026, and it's literally struct nbcon_write_context(9) β€” mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from