scx_ops_sanitize_err(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

okay bestie, welcome to scx_ops_sanitize_err(9) from the Kernel API Manual 🫢 this page is lowkey about making sure a -errno value is valid before it wrecks the vibe πŸ’…

🌸 NAME 🌸

scx_ops_sanitize_err β€” sanitize a -errno value ✨

✨ SYNOPSIS ✨

int scx_ops_sanitize_err (struct scx_sched *sch , const char *ops_name ,
       s32 err );

πŸŽ€ ARGUMENTS πŸŽ€

  • sch β€” the scx_sched to error out on error 😭
  • ops_name β€” the operation to blame on failure πŸ‘€
  • err β€” the -errno value to sanitize 🧚

πŸ’… DESCRIPTION πŸ’…

so what it does is verify that err is a valid -errno πŸ”. if it's not, it triggers scx_error and returns -EPROTO 🚨.

this is necessary because returning a rogue -errno up the chain can cause misbehaviors πŸ’€. for an example, a large negative return from ops.init_task triggers an oops when passed up the call chain because the value fails IS_ERR test after being encoded with ERR_PTR and then is handled as a pointer 😭. not the main character energy we want, fr fr.

πŸ¦‹ SEE ALSO πŸ¦‹

peep these, bestie: the kernel file ./kernel/sched/ext/internal.h, plus scx_add_event(9), __scx_add_event(9), struct scx_enable_args(9), struct sched_ext_ops(9), struct sched_ext_ops_cid(9), scx_arena_to_kaddr(9), scx_kaddr_to_arena(9), DEFINE_SCX_COMPAT_MARKER(9), scx_root_protected_live(9), scx_root_protected(9), scx_bypass_dsp_enabled(9), scx_has_subs(9), scx_task_sched(9), scx_task_sched_rcu(9), scx_task_on_sched(9), scx_prog_sched(9), and scx_parent(9) 🌈.

okay that's the whole page β€” signing off from ./kernel/sched/ext, October 2026, mwah πŸ«ΆπŸŽ€

πŸ“¦ where this page comes from