mq_timedsend on x64
send a message to a message queue
sys_mq_timedsend(mqd_t mqdes, const char *msg_ptr, size_t msg_len, unsigned int msg_prio, const struct __kernel_timespec *abs_timeout)
| number | 242 (0xf2) |
|---|---|
| abi | common |
| kconfig | CONFIG_POSIX_MQUEUE |
| family | mqueue see the whole family on x64 |
| entry point | sys_mq_timedsend |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | mq_timedsend(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 242, the syscall number |
rdi | mqd_t mqdes |
rsi | const char *msg_ptr |
rdx | size_t msg_len |
r10 | unsigned int msg_prio |
r8 | const struct __kernel_timespec *abs_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 279
- arm64 182
- arm 276
- riscv64 182
- ia32 279
- x32 1073742066
- loongarch64 182
- ppc64 264
- ppc 264
- s390x 273
- mips64 5232
- mipsn32 6236
- mipso32 4273
- alpha 434
- arc 182
- blackfin 280, removed in 4.17
- cris 279, removed in 4.17
- csky 182
- frv 279, removed in 4.17
- hexagon 182
- ia64 1264, removed in 6.7
- m32r 279, removed in 4.17
- m68k 273
- metag 182, removed in 4.17
- microblaze 279
- mn10300 279, removed in 4.17
- nds32 182, removed in 5.18
- nios2 182
- openrisc 182
- parisc 231
- score 182, removed in 4.17
- sh 279
- sparc 275
- sparc64 275
- tilegx 182, removed in 4.17
- tilepro 182, removed in 4.17
- xtensa 234
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/mq_timedsend