readahead on x64
initiate file readahead into page cache
sys_readahead(int fd, loff_t offset, size_t count)
| number | 187 (0xbb) |
|---|---|
| abi | common |
| entry point | sys_readahead |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | readahead(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 187, the syscall number |
rdi | int fd |
rsi | loff_t offset |
rdx | size_t count |
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 225
- arm64 213
- arm 225
- riscv64 213
- ia32 225
- x32 1073742011
- loongarch64 213
- ppc64 191
- ppc 191
- s390x 222
- mips64 5179
- mipsn32 6179
- mipso32 4223
- alpha 379
- arc 213
- blackfin 225, removed in 4.17
- cris 225, removed in 4.17
- csky 213
- frv 225, removed in 4.17
- hexagon 213
- ia64 1216, removed in 6.7
- m32r 225, removed in 4.17
- m68k 240
- metag 213, removed in 4.17
- microblaze 225
- mn10300 225, removed in 4.17
- nds32 213, removed in 5.18
- nios2 213
- openrisc 213
- parisc 207
- score 213, removed in 4.17
- sh 225
- sparc 205
- sparc64 205
- tilegx 213, removed in 4.17
- tilepro 213, removed in 4.17
- xtensa 260
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/readahead