msgctl on x64
System V message control operations
sys_msgctl(int msqid, int cmd, struct msqid_ds *buf)
| number | 71 (0x47) |
|---|---|
| abi | common |
| kconfig | CONFIG_SYSVIPC |
| family | sysvipc see the whole family on x64 |
| entry point | sys_msgctl |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | msgctl(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 71, the syscall number |
rdi | int msqid |
rsi | int cmd |
rdx | struct msqid_ds *buf |
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 402
- arm64 187
- arm 304
- riscv64 187
- ia32 402
- x32 1073741895
- loongarch64 187
- ppc64 402
- ppc 402
- s390x 402
- mips64 5069
- mipsn32 6069
- mipso32 4402
- alpha 200
- arc 187
- blackfin 334, removed in 4.17
- csky 187
- hexagon 187
- ia64 1112, removed in 6.7
- m68k 402
- metag 187, removed in 4.17
- microblaze 331
- nds32 187, removed in 5.18
- nios2 187
- openrisc 187
- parisc 191
- score 187, removed in 4.17
- sh 402
- sparc 402
- sparc64 402
- tilegx 187, removed in 4.17
- tilepro 187, removed in 4.17
- xtensa 169
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/msgctl