mlockall on x64
lock and unlock memory
sys_mlockall(int flags)
| number | 151 (0x97) |
|---|---|
| abi | common |
| entry point | sys_mlockall |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | mlockall(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 151, the syscall number |
rdi | int flags |
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 152
- arm64 230
- arm 152
- riscv64 230
- ia32 152
- x32 1073741975
- loongarch64 230
- ppc64 152
- ppc 152
- s390x 152
- mips64 5148
- mipsn32 6148
- mipso32 4156
- alpha 316
- arc 230
- cris 152, removed in 4.17
- csky 230
- frv 152, removed in 4.17
- hexagon 230
- ia64 1154, removed in 6.7
- m32r 152, removed in 4.17
- m68k 152
- metag 230, removed in 4.17
- microblaze 152
- mn10300 152, removed in 4.17
- nds32 230, removed in 5.18
- nios2 230
- openrisc 230
- parisc 152
- score 230, removed in 4.17
- sh 152
- sparc 239
- sparc64 239
- tilegx 230, removed in 4.17
- tilepro 230, removed in 4.17
- xtensa 86
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/mlockall