adjtimex on x64
tune kernel clock
sys_adjtimex(struct __kernel_timex *txc_p)
| number | 159 (0x9f) |
|---|---|
| abi | common |
| entry point | sys_adjtimex |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | adjtimex(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 159, the syscall number |
rdi | struct __kernel_timex *txc_p |
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 124
- arm64 171
- arm 124
- riscv64 171
- ia32 124
- x32 1073741983
- loongarch64 171
- ppc64 124
- ppc 124
- s390x 124
- mips64 5154
- mipsn32 6154
- mipso32 4124
- alpha 366
- arc 171
- blackfin 124, removed in 4.17
- cris 124, removed in 4.17
- csky 171
- frv 124, removed in 4.17
- hexagon 171
- ia64 1131, removed in 6.7
- m32r 124, removed in 4.17
- m68k 124
- metag 171, removed in 4.17
- microblaze 124
- mn10300 124, removed in 4.17
- nds32 171, removed in 5.18
- nios2 171
- openrisc 171
- parisc 124
- score 171, removed in 4.17
- sh 124
- sparc 219
- sparc64 219
- tilegx 171, removed in 4.17
- tilepro 171, removed in 4.17
- xtensa 194
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/adjtimex