mincore on x64
determine whether pages are resident in memory
sys_mincore(unsigned long start, size_t len, unsigned char *vec)
| number | 27 (0x1b) |
|---|---|
| abi | common |
| entry point | sys_mincore |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | mincore(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 27, the syscall number |
rdi | unsigned long start |
rsi | size_t len |
rdx | unsigned char *vec |
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 218
- arm64 232
- arm 219
- riscv64 232
- ia32 218
- x32 1073741851
- loongarch64 232
- ppc64 206
- ppc 206
- s390x 218
- mips64 5026
- mipsn32 6026
- mipso32 4217
- alpha 375
- arc 232
- cris 218, removed in 4.17
- csky 232
- frv 218, removed in 4.17
- hexagon 232
- ia64 1208, removed in 6.7
- m32r 218, removed in 4.17
- m68k 237
- metag 232, removed in 4.17
- microblaze 218
- mn10300 218, removed in 4.17
- nds32 232, removed in 5.18
- nios2 232
- openrisc 232
- parisc 72
- score 232, removed in 4.17
- sh 218
- sparc 78
- sparc64 78
- tilegx 232, removed in 4.17
- tilepro 232, removed in 4.17
- xtensa 90
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/mincore