mq_open on x64
open a message queue
sys_mq_open(const char *name, int oflag, umode_t mode, struct mq_attr *attr)
| number | 240 (0xf0) |
|---|---|
| abi | common |
| kconfig | CONFIG_POSIX_MQUEUE |
| family | mqueue see the whole family on x64 |
| entry point | sys_mq_open |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | mq_open(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 240, the syscall number |
rdi | const char *name |
rsi | int oflag |
rdx | umode_t mode |
r10 | struct mq_attr *attr |
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 277
- arm64 180
- arm 274
- riscv64 180
- ia32 277
- x32 1073742064
- loongarch64 180
- ppc64 262
- ppc 262
- s390x 271
- mips64 5230
- mipsn32 6234
- mipso32 4271
- alpha 432
- arc 180
- blackfin 278, removed in 4.17
- cris 277, removed in 4.17
- csky 180
- frv 277, removed in 4.17
- hexagon 180
- ia64 1262, removed in 6.7
- m32r 277, removed in 4.17
- m68k 271
- metag 180, removed in 4.17
- microblaze 277
- mn10300 277, removed in 4.17
- nds32 180, removed in 5.18
- nios2 180
- openrisc 180
- parisc 229
- score 180, removed in 4.17
- sh 277
- sparc 273
- sparc64 273
- tilegx 180, removed in 4.17
- tilepro 180, removed in 4.17
- xtensa 232
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/mq_open