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