msgsnd on x64
System V message queue operations
sys_msgsnd(int msqid, struct msgbuf *msgp, size_t msgsz, int msgflg)
| number | 69 (0x45) |
|---|---|
| abi | common |
| kconfig | CONFIG_SYSVIPC |
| family | sysvipc see the whole family on x64 |
| entry point | sys_msgsnd |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | msgsnd(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 69, the syscall number |
rdi | int msqid |
rsi | struct msgbuf *msgp |
rdx | size_t msgsz |
r10 | int msgflg |
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 400
- arm64 189
- arm 301
- riscv64 189
- ia32 400
- x32 1073741893
- loongarch64 189
- ppc64 400
- ppc 400
- s390x 400
- mips64 5067
- mipsn32 6067
- mipso32 4400
- alpha 203
- arc 189
- blackfin 337, removed in 4.17
- csky 189
- hexagon 189
- ia64 1110, removed in 6.7
- m68k 400
- metag 189, removed in 4.17
- microblaze 334
- nds32 189, removed in 5.18
- nios2 189
- openrisc 189
- parisc 188
- score 189, removed in 4.17
- sh 400
- sparc 400
- sparc64 400
- tilegx 189, removed in 4.17
- tilepro 189, removed in 4.17
- xtensa 167
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/msgsnd