mbind on x64
set memory policy for a memory range
sys_mbind(unsigned long start, unsigned long len, unsigned long mode, const unsigned long *nmask, unsigned long maxnode, unsigned flags)
| number | 237 (0xed) |
|---|---|
| abi | common |
| entry point | sys_mbind |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | mbind(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 237, the syscall number |
rdi | unsigned long start |
rsi | unsigned long len |
rdx | unsigned long mode |
r10 | const unsigned long *nmask |
r8 | unsigned long maxnode |
r9 | unsigned 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 274
- arm64 235
- arm 319
- riscv64 235
- ia32 274
- x32 1073742061
- loongarch64 235
- ppc64 259
- ppc 259
- s390x 268
- mips64 5227
- mipsn32 6231
- mipso32 4268
- arc 235
- csky 235
- frv 274, removed in 4.17
- hexagon 235
- ia64 1259, removed in 6.7
- m68k 268
- metag 235, removed in 4.17
- microblaze 274
- mn10300 274, removed in 4.17
- nds32 235, removed in 5.18
- nios2 235
- openrisc 235
- parisc 260
- score 235, removed in 4.17
- sh 274
- sparc 303
- sparc64 303
- tilegx 235, removed in 4.17
- tilepro 235, removed in 4.17
- xtensa 263
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/mbind