recvmmsg on x64
receive multiple messages on a socket
sys_recvmmsg(int fd, struct mmsghdr *mmsg, unsigned int vlen, unsigned int flags, struct __kernel_timespec *timeout)
| number | 299 (0x12b) |
|---|---|
| abi | 64 |
| entry point | sys_recvmmsg |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | recvmmsg(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 299, the syscall number |
rdi | int fd |
rsi | struct mmsghdr *mmsg |
rdx | unsigned int vlen |
r10 | unsigned int flags |
r8 | struct __kernel_timespec *timeout |
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 337
- arm64 243
- arm 365
- riscv64 243
- ia32 337
- x32 1073742361
- loongarch64 243
- ppc64 343
- ppc 343
- s390x 357
- mips64 5294
- mipsn32 6298
- mipso32 4335
- alpha 479
- arc 243
- blackfin 370, removed in 4.17
- cris 340, removed in 4.17
- csky 243
- hexagon 243
- ia64 1322, removed in 6.7
- m68k 371
- metag 243, removed in 4.17
- microblaze 367
- mn10300 338, removed in 4.17
- nds32 243, removed in 5.18
- nios2 243
- openrisc 243
- parisc 319
- score 243, removed in 4.17
- sh 357
- sparc 328
- sparc64 328
- tilegx 243, removed in 4.17
- tilepro 243, removed in 4.17
- xtensa 307
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/recvmmsg