shmdt on x64
System V shared memory operations
sys_shmdt(char *shmaddr)
| number | 67 (0x43) |
|---|---|
| abi | common |
| kconfig | CONFIG_SYSVIPC |
| family | sysvipc see the whole family on x64 |
| entry point | sys_shmdt |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | shmdt(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 67, the syscall number |
rdi | char *shmaddr |
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 398
- arm64 197
- arm 306
- riscv64 197
- ia32 398
- x32 1073741891
- loongarch64 197
- ppc64 398
- ppc 398
- s390x 398
- mips64 5065
- mipsn32 6065
- mipso32 4398
- alpha 211
- arc 197
- blackfin 340, removed in 4.17
- csky 197
- hexagon 197
- ia64 1115, removed in 6.7
- m68k 398
- metag 197, removed in 4.17
- microblaze 337
- nds32 197, removed in 5.18
- nios2 197
- openrisc 197
- parisc 193
- score 197, removed in 4.17
- sh 398
- sparc 398
- sparc64 398
- tilegx 197, removed in 4.17
- tilepro 197, removed in 4.17
- xtensa 95
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/shmdt