pwritev2 on x64
read or write data into multiple buffers
sys_pwritev2(unsigned long fd, const struct iovec *vec, unsigned long vlen, unsigned long pos_l, unsigned long pos_h, rwf_t flags)
| number | 328 (0x148) |
|---|---|
| abi | 64 |
| entry point | sys_pwritev2 |
| since | Linux 4.6 |
| man page | pwritev2(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 328, the syscall number |
rdi | unsigned long fd |
rsi | const struct iovec *vec |
rdx | unsigned long vlen |
r10 | unsigned long pos_l |
r8 | unsigned long pos_h |
r9 | rwf_t 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 379
- arm64 287
- arm 393
- riscv64 287
- ia32 379
- x32 1073742359, 1073742371
- loongarch64 287
- ppc64 381
- ppc 381
- s390x 377
- mips64 5322
- mipsn32 6326
- mipso32 4362
- alpha 521
- arc 287
- csky 287
- hexagon 287
- ia64 1349, removed in 6.7
- m68k 378
- metag 287, removed in 4.17
- microblaze 394
- nds32 287, removed in 5.18
- nios2 287
- openrisc 287
- parisc 348
- score 287, removed in 4.17
- sh 382
- sparc 359
- sparc64 359
- tilegx 287, removed in 4.17
- tilepro 287, removed in 4.17
- xtensa 347
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/pwritev2