sched_setparam on x64
set and get scheduling parameters
sys_sched_setparam(pid_t pid, struct sched_param *param)
| number | 142 (0x8e) |
|---|---|
| abi | common |
| entry point | sys_sched_setparam |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | sched_setparam(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 142, the syscall number |
rdi | pid_t pid |
rsi | struct sched_param *param |
rax | the return value |
Then run syscall to enter the kernel.
The syscall instruction clobbers rcx (the return address lands in rcx) and r11 (the flags land in r11).
Since Linux 5.14 the kernel reads the syscall number from eax and ignores the upper 32 bits of rax. Older kernels fail with ENOSYS when those bits are not zero, and mov eax, N clears them, so it works on both.
Same syscall on other architectures
- x86 154
- arm64 118
- arm 154
- riscv64 118
- ia32 154
- x32 1073741966
- loongarch64 118
- ppc64 154
- ppc 154
- s390x 154
- mips64 5139
- mipsn32 6139
- mipso32 4158
- alpha 330
- arc 118
- blackfin 154, removed in 4.17
- cris 154, removed in 4.17
- csky 118
- frv 154, removed in 4.17
- hexagon 118
- ia64 1161, removed in 6.7
- m32r 154, removed in 4.17
- m68k 154
- metag 118, removed in 4.17
- microblaze 154
- mn10300 154, removed in 4.17
- nds32 118, removed in 5.18
- nios2 118
- openrisc 118
- parisc 154
- score 118, removed in 4.17
- sh 154
- sparc 241
- sparc64 241
- tilegx 118, removed in 4.17
- tilepro 118, removed in 4.17
- xtensa 212
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/sched_setparam