sendmmsg on x64
send multiple messages on a socket
sys_sendmmsg(int fd, struct mmsghdr *mmsg, unsigned int vlen, unsigned int flags)
| number | 307 (0x133) |
|---|---|
| abi | 64 |
| entry point | sys_sendmmsg |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | sendmmsg(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 307, the syscall number |
rdi | int fd |
rsi | struct mmsghdr *mmsg |
rdx | unsigned int vlen |
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 345
- arm64 269
- arm 374
- riscv64 269
- ia32 345
- x32 1073742362
- loongarch64 269
- ppc64 349
- ppc 349
- s390x 358
- mips64 5302
- mipsn32 6307
- mipso32 4343
- alpha 503
- arc 269
- blackfin 380, removed in 4.17
- cris 347, removed in 4.17
- csky 269
- hexagon 269
- ia64 1331, removed in 6.7
- m68k 372
- metag 269, removed in 4.17
- microblaze 376
- nds32 269, removed in 5.18
- nios2 269
- openrisc 269
- parisc 329
- score 269, removed in 4.17
- sh 363
- sparc 336
- sparc64 336
- tilegx 269, removed in 4.17
- tilepro 269, removed in 4.17
- xtensa 115
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/sendmmsg