syscall_set_nr(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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 β€” the task_pt_regs of that task
  • nr β€” 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 when task is stopped for tracing on entry to a system call, due to SYSCALL_WORK_SYSCALL_TRACE or SYSCALL_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:


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