fchmodat2 on x64
sys_fchmodat2(int dfd, const char *filename, umode_t mode, unsigned int flags)
| number | 452 (0x1c4) |
|---|---|
| abi | common |
| entry point | sys_fchmodat2 |
| since | Linux 6.6 |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 452, the syscall number |
rdi | int dfd |
rsi | const char *filename |
rdx | umode_t mode |
r10 | unsigned 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 452
- arm64 452
- arm 452
- riscv64 452
- ia32 452
- x32 1073742276
- loongarch64 452
- ppc64 452
- ppc 452
- s390x 452
- mips64 5452
- mipsn32 6452
- mipso32 4452
- alpha 562
- arc 452
- csky 452
- hexagon 452
- ia64 1476, removed in 6.7
- m68k 452
- microblaze 452
- nios2 452
- openrisc 452
- parisc 452
- sh 452
- sparc 452
- sparc64 452
- xtensa 452
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/fchmodat2