process_vm_writev on x64
transfer data between process address spaces
sys_process_vm_writev(pid_t pid, const struct iovec *lvec, unsigned long liovcnt, const struct iovec *rvec, unsigned long riovcnt, unsigned long flags)
| number | 311 (0x137) |
|---|---|
| abi | 64 |
| entry point | sys_process_vm_writev |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | process_vm_writev(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 311, 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 348
- arm64 271
- arm 377
- riscv64 271
- ia32 348
- x32 1073742364
- loongarch64 271
- ppc64 352
- ppc 352
- s390x 341
- mips64 5305
- mipsn32 6310
- mipso32 4346
- alpha 505
- arc 271
- blackfin 382, removed in 4.17
- cris 349, removed in 4.17
- csky 271
- hexagon 271
- ia64 1333, removed in 6.7
- m68k 346
- metag 271, removed in 4.17
- microblaze 378
- nds32 271, removed in 5.18
- nios2 271
- openrisc 271
- parisc 331
- score 271, removed in 4.17
- sh 366
- sparc 339
- sparc64 339
- tilegx 271, removed in 4.17
- tilepro 271, removed in 4.17
- xtensa 323
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/process_vm_writev