preadv on x64
read or write data into multiple buffers
sys_preadv(unsigned long fd, const struct iovec *vec, unsigned long vlen, unsigned long pos_l, unsigned long pos_h)
| number | 295 (0x127) |
|---|---|
| abi | 64 |
| entry point | sys_preadv |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | preadv(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 295, 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 |
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 333
- arm64 69
- arm 361
- riscv64 69
- ia32 333
- x32 1073742358
- loongarch64 69
- ppc64 320
- ppc 320
- s390x 328
- mips64 5289
- mipsn32 6293
- mipso32 4330
- alpha 490
- arc 69
- blackfin 366, removed in 4.17
- cris 333, removed in 4.17
- csky 69
- frv 333, removed in 4.17
- hexagon 69
- ia64 1319, removed in 6.7
- m68k 329
- metag 69, removed in 4.17
- microblaze 363
- mn10300 334, removed in 4.17
- nds32 69, removed in 5.18
- nios2 69
- openrisc 69
- parisc 315
- score 69, removed in 4.17
- sh 333
- sparc 324
- sparc64 324
- tilegx 69, removed in 4.17
- tilepro 69, removed in 4.17
- xtensa 317
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/preadv