umount2 on x64
unmount filesystem
sys_umount(char *name, int flags)
| number | 166 (0xa6) |
|---|---|
| abi | common |
| entry point | sys_umount |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | umount2(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 166, the syscall number |
rdi | char *name |
rsi | int flags |
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 52
- arm64 39
- arm 52
- riscv64 39
- ia32 52
- x32 1073741990
- loongarch64 39
- ppc64 52
- ppc 52
- s390x 52
- mips64 5161
- mipsn32 6161
- mipso32 4052
- alpha 22
- arc 39
- blackfin 52, removed in 4.17
- cris 52, removed in 4.17
- csky 39
- frv 52, removed in 4.17
- hexagon 39
- ia64 1044, removed in 6.7
- m32r 52, removed in 4.17
- m68k 52
- metag 39, removed in 4.17
- microblaze 52
- mn10300 52, removed in 4.17
- nds32 39, removed in 5.18
- nios2 39
- openrisc 39
- parisc 52
- score 39, removed in 4.17
- sh 52
- sparc 45
- sparc64 45
- tilegx 39, removed in 4.17
- tilepro 39, removed in 4.17
- xtensa 171
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/umount2