sched_getscheduler on x64
set and get scheduling policy/parameters
sys_sched_getscheduler(pid_t pid)
| number | 145 (0x91) |
|---|---|
| abi | common |
| entry point | sys_sched_getscheduler |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | sched_getscheduler(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 145, the syscall number |
rdi | pid_t pid |
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 157
- arm64 120
- arm 157
- riscv64 120
- ia32 157
- x32 1073741969
- loongarch64 120
- ppc64 157
- ppc 157
- s390x 157
- mips64 5142
- mipsn32 6142
- mipso32 4161
- alpha 333
- arc 120
- blackfin 157, removed in 4.17
- cris 157, removed in 4.17
- csky 120
- frv 157, removed in 4.17
- hexagon 120
- ia64 1162, removed in 6.7
- m32r 157, removed in 4.17
- m68k 157
- metag 120, removed in 4.17
- microblaze 157
- mn10300 157, removed in 4.17
- nds32 120, removed in 5.18
- nios2 120
- openrisc 120
- parisc 157
- score 120, removed in 4.17
- sh 157
- sparc 244
- sparc64 244
- tilegx 120, removed in 4.17
- tilepro 120, removed in 4.17
- xtensa 215
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/sched_getscheduler