statx on x64
get file status (extended)
sys_statx(int dfd, const char *path, unsigned flags, unsigned mask, struct statx *buffer)
| number | 332 (0x14c) |
|---|---|
| abi | common |
| entry point | sys_statx |
| since | Linux 4.11 |
| man page | statx(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 332, the syscall number |
rdi | int dfd |
rsi | const char *path |
rdx | unsigned flags |
r10 | unsigned mask |
r8 | struct statx *buffer |
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 383
- arm64 291
- arm 397
- riscv64 291
- ia32 383
- x32 1073742156
- loongarch64 291
- ppc64 383
- ppc 383
- s390x 379
- mips64 5326
- mipsn32 6330
- mipso32 4366
- alpha 522
- arc 291
- csky 291
- hexagon 291
- ia64 1350, removed in 6.7
- m68k 379
- metag 291, removed in 4.17
- microblaze 398
- nds32 291, removed in 5.18
- nios2 291
- openrisc 291
- parisc 349
- score 291, removed in 4.17
- sh 383
- sparc 360
- sparc64 360
- tilegx 291, removed in 4.17
- tilepro 291, removed in 4.17
- xtensa 351
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/statx