msgget on x64
get a System V message queue identifier
sys_msgget(key_t key, int msgflg)
| number | 68 (0x44) |
|---|---|
| abi | common |
| kconfig | CONFIG_SYSVIPC |
| family | sysvipc see the whole family on x64 |
| entry point | sys_msgget |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | msgget(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 68, the syscall number |
rdi | key_t key |
rsi | 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 399
- arm64 186
- arm 303
- riscv64 186
- ia32 399
- x32 1073741892
- loongarch64 186
- ppc64 399
- ppc 399
- s390x 399
- mips64 5066
- mipsn32 6066
- mipso32 4399
- alpha 201
- arc 186
- blackfin 335, removed in 4.17
- csky 186
- hexagon 186
- ia64 1109, removed in 6.7
- m68k 399
- metag 186, removed in 4.17
- microblaze 332
- nds32 186, removed in 5.18
- nios2 186
- openrisc 186
- parisc 190
- score 186, removed in 4.17
- sh 399
- sparc 399
- sparc64 399
- tilegx 186, removed in 4.17
- tilepro 186, removed in 4.17
- xtensa 166
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/msgget