xbc_init(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ xbc_init ✨

okay so this is a page from the Kernel API Manual β€” yes bestie, the kernel has man pages too, we love a documented king πŸ’… β€” and it's all about xbc_init, which parses your XBC file and builds the whole XBC internal tree. very main character energy honestly 🌸


πŸŽ€ NAME πŸŽ€

xbc_init β€” parse the XBC file you handed it and build the XBC internal tree 🌳✨


πŸ¦‹ SYNOPSIS πŸ¦‹

int xbc_init (const char *data , size_t size , const char **emsg , int
*epos );

πŸ’– ARGUMENTS πŸ’–

  • data β€” the boot config text original data, aka the actual raw bytes you're feeding in πŸ“
  • size β€” the size of data, like how many bytes we're working with, no cap
  • emsg β€” a pointer of const char * where the error message gets stored πŸ™ˆ
  • epos β€” a pointer of int where the error position gets stored

πŸ”₯ DESCRIPTION πŸ”₯

this parses the boot config text in data. and listen β€” size must be smaller than XBC_DATA_MAX. not "should", must. that's the vibe check and if you fail it that's on you 😭

if it works out, it returns the number of stored nodes (>0) β€” slay πŸŽ‰ β€” or -errno if there's any error at all.

in error cases: emsg gets updated with an error message, and epos gets updated with the error position, which is the byte offset of buf. and if the error is not a parser error? then epos will be -1. iconic of it honestly 🫢


πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./lib/bootconfig.c β€” and honestly the whole friend group:


πŸ’œ and that's the whole page bestie πŸ’œ

this one's shipped straight out of ./lib, dated October 2026, and it's literally called xbc_init(9) β€” go build that tree, you got this πŸ§šβœ¨πŸŽ€

πŸ“¦ where this page comes from