setpriority on x64
get/set program scheduling priority
sys_setpriority(int which, int who, int niceval)
| number | 141 (0x8d) |
|---|---|
| abi | common |
| entry point | sys_setpriority |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | setpriority(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 141, the syscall number |
rdi | int which |
rsi | int who |
rdx | int niceval |
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 97
- arm64 140
- arm 97
- riscv64 140
- ia32 97
- x32 1073741965
- loongarch64 140
- ppc64 97
- ppc 97
- s390x 97
- mips64 5138
- mipsn32 6138
- mipso32 4097
- alpha 96
- arc 140
- blackfin 97, removed in 4.17
- cris 97, removed in 4.17
- csky 140
- frv 97, removed in 4.17
- hexagon 140
- ia64 1102, removed in 6.7
- m32r 97, removed in 4.17
- m68k 97
- metag 140, removed in 4.17
- microblaze 97
- mn10300 97, removed in 4.17
- nds32 140, removed in 5.18
- nios2 140
- openrisc 140
- parisc 97
- score 140, removed in 4.17
- sh 97
- sparc 96
- sparc64 96
- tilegx 140, removed in 4.17
- tilepro 140, removed in 4.17
- xtensa 133
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/setpriority