STRUCT EXTCONTEXT(9)

๐Ÿ“ฆ version 7.3.1, in nixpkgs unstable

๐Ÿ’… NAME ๐Ÿ’…

struct extcontext โ€” the extended context header structure, aka the lil' header that kicks off every extended context block ๐ŸŽ€

oh and btw this page lives in the Kernel API Manual, section 9, bestie ๐Ÿซถ


โœจ SYNOPSIS โœจ

struct extcontext {
    unsigned int            magic;
    unsigned int            size;
 };

like... that's it. two fields. iconic minimalism ๐Ÿ’…


๐ŸŒธ Members ๐ŸŒธ

  • magic โ€” the magic value, and no it's not a vibe, it's literally what tells you which type of extended context you're looking at ๐Ÿ”ฎโœจ
  • size โ€” the size, in bytes, of the enclosing structure. yes the whole thing. she's measuring the fit ๐Ÿ‘‘

๐Ÿฆ‹ Description ๐Ÿฆ‹

okay so picture this: extended context structures are here to carry context that just does not fit inside struct sigcontext. she simply doesn't have the room, bestie ๐Ÿ˜ญ

so instead they get placed sequentially in memory, right at the end of struct ucontext and struct sigframe. and each one of those extended context structures starts with a header โ€” and that header is literally this struct. main character energy ๐ŸŒŸ

the type of context being represented? indicated by the magic field, periodt. userland can go through each extended context structure and check it against the magic values it recognises ๐Ÿ‘€โœจ

and the size field is the glow-up that makes the whole thing future-proof ๐Ÿ’– it lets any unrecognised context get skipped right over โ€” so future expansion is totally fine, no cap ๐Ÿš€

the end of the extended context data is indicated by the magic value END_EXTCONTEXT_MAGIC. that's the "we're done here" signal, iykyk ๐ŸŽฌ


๐ŸŒˆ SEE ALSO ๐ŸŒˆ

  • Kernel file ./arch/mips/include/uapi/asm/ucontext.h struct msa_extcontext(9)
  • struct ucontext(9)

okay that's the whole page bestie, go forth and check your magics ๐Ÿ’œ

source file: ./arch/mips/include/uapi/asm ยท version: Kernel API Manual ยท dated: October 2026 ยท titled struct extcontext(9) ๐ŸŽ€

๐Ÿ“ฆ where this page comes from