cap_capget(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… cap_capget β€” kernel API manual, but make it make sense

okay so bestie, welcome to cap_capget(9) from the Kernel API Manual ✨ this one is lowkey a little legend in ./security/commoncap.c and honestly it's giving "quiet little helper that just works". Let's get into it 🫢


🌸 SYNOPSIS 🌸

int cap_capget (const struct task_struct *target , kernel_cap_t
*effective , kernel_cap_t *inheritable , kernel_cap_t *permitted );

like, that's the whole signature. no cap. returns an int, takes four args, four pointers, one of which is const because we're respectful like that πŸ’…


πŸŽ€ ARGUMENTS πŸŽ€

  • target β€” the task you're snooping on πŸ‘€ the one whose capability sets you wanna retrieve. it's a const struct task_struct *, so no touching.
  • effective β€” the place to record the effective set. this is where the answer goes, bestie.
  • inheritable β€” the place to record the inheritable set. another output home 🏠
  • permitted β€” the place to record the permitted set. last but literally not least.

all three of those output pointers are kernel_cap_t *, just so we're clear 🧚


✨ DESCRIPTION ✨

so what does it do? this function retrieves the capabilities of the nominated task and returns them to the caller. that's it. that's the whole vibe. iconic behaviour honestly πŸ”₯

like β€” you name the task in target, and it hands the capability sets back to you through effective, inheritable and permitted. clean, simple, main character energy πŸ‘‘


πŸ¦‹ SEE ALSO πŸ¦‹

all of these live in the kernel file ./security/commoncap.c and they're the whole friend group, fr fr:

go read them all, iykyk πŸ“šπŸ’œ


ngl there are no warnings, no exit statuses, no env vars and no bug notes on this one β€” it's a chill little getter. don't go inventing drama where there is none πŸ™ˆ

okay that's the page!! this cutie lives in the ./security directory of the kernel tree, comes from the Kernel API Manual, and the version on record is dated October 2026 🌈 so go forth and retrieve those capability sets, bestie β€” slay πŸ’…βœ¨

πŸ“¦ where this page comes from