vmsplice on x64
splice user pages to/from a pipe
sys_vmsplice(int fd, const struct iovec *iov, unsigned long nr_segs, unsigned int flags)
| number | 278 (0x116) |
|---|---|
| abi | 64 |
| entry point | sys_vmsplice |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | vmsplice(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 278, the syscall number |
rdi | int fd |
rsi | const struct iovec *iov |
rdx | unsigned long nr_segs |
r10 | unsigned int 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 316
- arm64 75
- arm 343
- riscv64 75
- ia32 316
- x32 1073742356
- loongarch64 75
- ppc64 285
- ppc 285
- s390x 309
- mips64 5266
- mipsn32 6270
- mipso32 4307
- alpha 471
- arc 75
- blackfin 345, removed in 4.17
- cris 316, removed in 4.17
- csky 75
- frv 316, removed in 4.17
- hexagon 75
- ia64 1302, removed in 6.7
- m32r 316, removed in 4.17
- m68k 309
- metag 75, removed in 4.17
- microblaze 316
- mn10300 317, removed in 4.17
- nds32 75, removed in 5.18
- nios2 75
- openrisc 75
- parisc 294
- score 75, removed in 4.17
- sh 316
- sparc 25
- sparc64 25
- tilegx 75, removed in 4.17
- tilepro 75, removed in 4.17
- xtensa 270
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/vmsplice