ns_capable(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ ns_capable(9) ✨

okay bestie, welcome to the Kernel API Manual β€” today’s main character is ns_capable(9), and we’re gonna get you comfy with it πŸ’–


πŸŽ€ NAME πŸŽ€

  • ns_capable β€” determine if the current task has a superior capability in effect ✨

🌸 SYNOPSIS 🌸

bool ns_capable (struct user_namespace *ns , int cap );

πŸ’… ARGUMENTS πŸ’…

  • ns β€” the usernamespace where we want the capability to be in effect 🫢
  • cap β€” the capability we’re testing for πŸ”

πŸ¦‹ DESCRIPTION πŸ¦‹

So here’s the tea: this returns true if the current task has the given superior capability currently available for use, and false if not. No cap, that’s the whole vibe check 😌

It also sets PF_SUPERPRIV on the task if the capability is available β€” and it does that on the assumption that it’s about to be used. So yeah, it’s not just peeking at the capability, it’s also flagging the task like β€œbestie is about to use this” πŸ’…

🌈 SEE ALSO 🌈

Kernel file: ./kernel/capability.c β€” and these iconic little references too πŸ‘‘


signing off from ./kernel, stamped October 2026, and this was the ns_capable(9) page β€” slay and goodbye πŸ’–πŸ¦‹

πŸ“¦ where this page comes from