open_tree on x64
open path or create detached mount object and attach to fd
sys_open_tree(int dfd, const char *path, unsigned flags)
| number | 428 (0x1ac) |
|---|---|
| abi | common |
| entry point | sys_open_tree |
| since | Linux 5.2 |
| man page | open_tree(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 428, the syscall number |
rdi | int dfd |
rsi | const char *path |
rdx | unsigned 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 428
- arm64 428
- arm 428
- riscv64 428
- ia32 428
- x32 1073742252
- loongarch64 428
- ppc64 428
- ppc 428
- s390x 428
- mips64 5428
- mipsn32 6428
- mipso32 4428
- alpha 538
- arc 428
- csky 428
- hexagon 428
- ia64 1452, removed in 6.7
- m68k 428
- microblaze 428
- nds32 428, removed in 5.18
- nios2 428
- openrisc 428
- parisc 428
- sh 428
- sparc 428
- sparc64 428
- xtensa 428
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/open_tree