readv on x64
read or write data into multiple buffers
sys_readv(unsigned long fd, const struct iovec *vec, unsigned long vlen)
| number | 19 (0x13) |
|---|---|
| abi | 64 |
| entry point | sys_readv |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | readv(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 19, the syscall number |
rdi | unsigned long fd |
rsi | const struct iovec *vec |
rdx | unsigned long vlen |
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 145
- arm64 65
- arm 145
- riscv64 65
- ia32 145
- x32 1073742339
- loongarch64 65
- ppc64 145
- ppc 145
- s390x 145
- mips64 5018
- mipsn32 6018
- mipso32 4145
- alpha 120
- arc 65
- blackfin 145, removed in 4.17
- cris 145, removed in 4.17
- csky 65
- frv 145, removed in 4.17
- hexagon 65
- ia64 1146, removed in 6.7
- m32r 145, removed in 4.17
- m68k 145
- metag 65, removed in 4.17
- microblaze 145
- mn10300 145, removed in 4.17
- nds32 65, removed in 5.18
- nios2 65
- openrisc 65
- parisc 145
- score 65, removed in 4.17
- sh 145
- sparc 120
- sparc64 120
- tilegx 65, removed in 4.17
- tilepro 65, removed in 4.17
- xtensa 24
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/readv