process_vm_readv on x64
transfer data between process address spaces
sys_process_vm_readv(pid_t pid, const struct iovec *lvec, unsigned long liovcnt, const struct iovec *rvec, unsigned long riovcnt, unsigned long flags)
| number | 310 (0x136) |
|---|---|
| abi | 64 |
| entry point | sys_process_vm_readv |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | process_vm_readv(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 310, the syscall number |
rdi | pid_t pid |
rsi | const struct iovec *lvec |
rdx | unsigned long liovcnt |
r10 | const struct iovec *rvec |
r8 | unsigned long riovcnt |
r9 | unsigned long 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 347
- arm64 270
- arm 376
- riscv64 270
- ia32 347
- x32 1073742363
- loongarch64 270
- ppc64 351
- ppc 351
- s390x 340
- mips64 5304
- mipsn32 6309
- mipso32 4345
- alpha 504
- arc 270
- blackfin 381, removed in 4.17
- cris 348, removed in 4.17
- csky 270
- hexagon 270
- ia64 1332, removed in 6.7
- m68k 345
- metag 270, removed in 4.17
- microblaze 377
- nds32 270, removed in 5.18
- nios2 270
- openrisc 270
- parisc 330
- score 270, removed in 4.17
- sh 365
- sparc 338
- sparc64 338
- tilegx 270, removed in 4.17
- tilepro 270, removed in 4.17
- xtensa 322
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/process_vm_readv