user_regset_active_fn(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… user_regset_active_fn(9)

okay so bestie, you've stumbled into the Kernel API Manual and this one is about a little typedef called user_regset_active_fn β€” it's the type of the @active function inside &struct user_regset. iykyk 🫢


✨ SYNOPSIS ✨

typedef int user_regset_active_fn (struct task_struct *target , const
       struct user_regset *regset );

like, that's the whole signature. short king behavior honestly πŸ‘‘


πŸŽ€ ARGUMENTS πŸŽ€

  • target β€” the thread we're being nosy about and examining πŸ‘€
  • regset β€” the regset we're examining, periodt

🌸 DESCRIPTION 🌸

ok so the vibe check here is: what does your implementation return? and the answer depends, no cap πŸ’β€β™€οΈ

  • Return -ENODEV if it's not available on the hardware that was found. it's giving "not supported on this ✨silicon✨" 😭
  • Return 0 if there's no interesting state in this thread. nothing to see here bestie.
  • Return >0 β€” that number being the number of size units of interesting state. so like, >0 = there is tea πŸ“

and here's the important bit, so don't skip it: any get call that fetches state beyond that number will see the default initialization state for this data. which means β€” huge β€” a caller that already knows what the default state is need not copy it all out. efficiency slay πŸ”₯

🫢 important caveat: this call is optional. the pointer is NULL if there's no inexpensive check to yield a value < n. so if you see NULL, that's not a bug, that's just the design, bestie.

πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./include/linux/regset.h, plus the whole friend group:


ok that's the whole page, mwah πŸ’‹ it lives in ./include/linux, and this lil manual page was brought to you by October 2026 β€” see you in the next group chat, bestie πŸ¦‹βœ¨πŸŽ€

πŸ“¦ where this page comes from