symlink on x64
make a new name for a file
sys_symlink(const char *old, const char *new)
| number | 88 (0x58) |
|---|---|
| abi | common |
| entry point | sys_symlink |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | symlink(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 88, the syscall number |
rdi | const char *old |
rsi | const char *new |
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 83
- arm 83
- ia32 83
- x32 1073741912
- ppc64 83
- ppc 83
- s390x 83
- mips64 5086
- mipsn32 6086
- mipso32 4083
- alpha 57
- blackfin 83, removed in 4.17
- cris 83, removed in 4.17
- frv 83, removed in 4.17
- ia64 1091, removed in 6.7
- m32r 83, removed in 4.17
- m68k 83
- microblaze 83
- mn10300 83, removed in 4.17
- parisc 83
- score 1036, removed in 4.17
- sh 83
- sparc 57
- sparc64 57
- xtensa 34
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/symlink