file_getattr on x64
sys_file_getattr(int dfd, const char *filename, struct file_attr *attr, size_t usize, unsigned int at_flags)
| number | 468 (0x1d4) |
|---|---|
| abi | common |
| entry point | sys_file_getattr |
| since | Linux 6.17 |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 468, the syscall number |
rdi | int dfd |
rsi | const char *filename |
rdx | struct file_attr *attr |
r10 | size_t usize |
r8 | unsigned int at_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 468
- arm64 468
- arm 468
- riscv64 468
- ia32 468
- x32 1073742292
- loongarch64 468
- ppc64 468
- ppc 468
- s390x 468
- mips64 5468
- mipsn32 6468
- mipso32 4468
- alpha 578
- arc 468
- csky 468
- hexagon 468
- m68k 468
- microblaze 468
- nios2 468
- openrisc 468
- parisc 468
- sh 468
- sparc 468
- sparc64 468
- xtensa 468
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/file_getattr