syscall_set_nr(9)
β¨ syscall_set_nr β¨
okay bestie, so this one is a <purple>kernel API</purple> page from the Kernel API Manual (<cyan>syscall_set_nr(9)</cyan>, section 9, iykyk) and it's literally about swapping out which system call a task is running π
πΈ NAME πΈ
syscall_set_nr β change the system call a task is executing π
π¦ SYNOPSIS π¦
void syscall_set_nr (struct task_struct *task , struct pt_regs *regs ,
int nr );
like, that's the whole signature, no cap β¨
π ARGUMENTS π
taskβ the task of interest, and bestie it must be blocked π«Άregsβ thetask_pt_regsof thattasknrβ the system call number π
π DESCRIPTION π
So what it does: it changes the system call number that task is about to execute. Slay. π
β οΈ but listen, it's only valid to call this whentaskis stopped for tracing on entry to a system call, due toSYSCALL_WORK_SYSCALL_TRACEorSYSCALL_WORK_SYSCALL_AUDIT. That's the vibe check and it is not optional, fr fr.
π SEE ALSO π
Kernel file ./include/asm-generic/syscall.h plus the whole friend group:
syscall_get_nr(9)syscall_rollback(9)syscall_get_error(9)syscall_get_return_value(9)syscall_set_return_value(9)syscall_get_arguments(9)syscall_set_arguments(9)syscall_get_arch(9)
okay that's the whole page bestie, mwah π this iconic little entry lives in ./include/asm-generic in the Kernel API Manual, dated <lavender>October 2026</lavender> β go be the main character of your own syscall tracing era π§ββοΈπ
π¦ 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