scx_bpf_sub_caps(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… scx_bpf_sub_caps(9)

ok so bestie, welcome to the Kernel API Manual ✨ β€” this page is literally about reading cap cmasks for yourself or your direct child, and honestly it's giving "small function, big feelings". Let's get into it 🫢


🌸 NAME 🌸

scx_bpf_sub_caps β€” read self's or a direct child's cap cmasks πŸ’–


✨ SYNOPSIS ✨

__bpf_kfunc s32 scx_bpf_sub_caps (u64 cgroup_id , u64 caps , struct
scx_cmask *out__arena , const struct bpf_prog_aux *aux );

πŸŽ€ ARGUMENTS πŸŽ€

  • cgroup_id β€” pass 0 for self, or hand over a direct child's cgroup id. that's the whole vibe ✨
  • caps β€” one or more SCX_CAP_* bits. yes, more than one, go off king πŸ‘‘
  • out__arena β€” the cmask that receives the union of caps within its range. it's the little bucket your answer drops into πŸͺ£πŸ’œ
  • aux β€” implicit BPF argument. not me having to explain this every time πŸ™ˆ it's just there, bestie.

πŸ’… DESCRIPTION πŸ’…

So what does it actually do? It reads the cap cmasks granted on each cid β€” for self when cgroup_id is 0, or for a direct child otherwise. it's the literal granted set, no cap, fr fr πŸ’€

and there's a boundary, okay? a sched can read only itself or a direct child. that's the rule, periodt. 🚧

Return values, because iykyk:

  • 0 β€” slay, it worked ⭐
  • -ENODEV β€” cgroup_id names no direct child, so like… who even is she 😭
  • -EINVAL β€” bad inputs. check ur args bestie πŸ“

πŸ¦‹ SEE ALSO πŸ¦‹

the whole friend group πŸ’œ β€” Kernel file ./kernel/sched/ext/sub.c and literally all of these:


and that's the whole page bestie 🌈✨ this one's straight outta ./kernel/sched/ext, dated October 2026 β€” go forth and read those cmasks, icon πŸ’…πŸ‘‘πŸŽ€

πŸ“¦ where this page comes from