cap_task_setscheduler(9)
β¨ cap_task_setscheduler β the Kernel API Manual π
okay so bestie, you know how Linux has that whole capability system where it's like "who's allowed to do what"? this is one of those little helper functions, and it lives in the kernel API manual, section 9. it's giving very niche, very important, very "if you know you know" π
πΈ NAME πΈ
cap_task_setscheduler β the vibe check for whether a scheduler policy change is even allowed π
so like, before someone goes and messes with a task's scheduling policy, this function is the one that's like "hold up, do you have permission for that?" π«Ά
π¦ SYNOPSIS π¦
int cap_task_setscheduler (struct task_struct *p );
literally that's the whole signature. one function, one argument, one int coming back at you. slay β¨
π ARGUMENTS π
pβ the task to affect. like, this is the task we're asking about. the one whose scheduler policy situation we're checking up on. main character energy fr fr π
π DESCRIPTION π
so here's the tea π: cap_task_setscheduler determines if the requested scheduler policy change is permitted for the specified task.
that's it, that's the whole job. it's a permission check. it looks at the request and goes "yeah that's fine" or "nope, absolutely not" β and it tells you which via the return value. no cap, that's genuinely all it does π
β RETURN β
0β permission is granted π (you're so back)-veβ denied π (it's over)
that's the whole contract. zero means go, negative means no. classic kernel style, iconic behavior π
π§ SEE ALSO π§
okay this is the part where we list literally everyone in the friend group, so buckle up bestie π
it all lives in the kernel file ./security/commoncap.c β that's the home base π
and then the whole squad:
cap_capable_helper(9)cap_capable(9)cap_settime(9)cap_ptrace_access_check(9)cap_ptrace_traceme(9)cap_capget(9)cap_capset(9)cap_inode_need_killpriv(9)cap_inode_killpriv(9)kuid_root_in_ns(9)rootid_from_xattr(9)cap_convert_nscap(9)get_vfs_caps_from_disk(9)cap_bprm_creds_from_file(9)cap_inode_setxattr(9)cap_inode_removexattr(9)cap_task_fix_setuid(9)cap_task_setioprio(9)cap_task_setnice(9)cap_task_prctl(9)cap_vm_enough_memory(9)cap_mmap_addr(9)
like, the whole capability crew. go read them, they're all doing their little part π¦
π real talk though: the return is -ve (negative) on denial, not a specific errno value listed here β so don't go assuming which negative number you get. the page doesn't say, and neither will i π«Ά
and that's a wrap, bestie! this page came out of the ./security source, dated October 2026, and it's filed under cap_task_setscheduler(9) in the kernel API manual. go forth and schedule responsibly πβ¨π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms