process_madvise on x64
give advice about use of memory to a process
sys_process_madvise(int pidfd, const struct iovec *vec, size_t vlen, int behavior, unsigned int flags)
| number | 440 (0x1b8) |
|---|---|
| abi | common |
| kconfig | CONFIG_ADVISE_SYSCALLS |
| entry point | sys_process_madvise |
| since | Linux 5.10 |
| man page | process_madvise(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 440, the syscall number |
rdi | int pidfd |
rsi | const struct iovec *vec |
rdx | size_t vlen |
r10 | int behavior |
r8 | unsigned 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 440
- arm64 440
- arm 440
- riscv64 440
- ia32 440
- x32 1073742264
- loongarch64 440
- ppc64 440
- ppc 440
- s390x 440
- mips64 5440
- mipsn32 6440
- mipso32 4440
- alpha 550
- arc 440
- csky 440
- hexagon 440
- ia64 1464, removed in 6.7
- m68k 440
- microblaze 440
- nds32 440, removed in 5.18
- nios2 440
- openrisc 440
- parisc 440
- sh 440
- sparc 440
- sparc64 440
- xtensa 440
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/process_madvise