statfs on x64
get filesystem statistics
sys_statfs(const char *path, struct statfs *buf)
| number | 137 (0x89) |
|---|---|
| abi | common |
| entry point | sys_statfs |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | statfs(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 137, the syscall number |
rdi | const char *path |
rsi | struct statfs *buf |
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 99
- arm64 43
- arm 99
- riscv64 43
- ia32 99
- x32 1073741961
- loongarch64 43
- ppc64 99
- ppc 99
- s390x 99
- mips64 5134
- mipsn32 6134
- mipso32 4099
- alpha 328
- blackfin 99, removed in 4.17
- cris 99, removed in 4.17
- frv 99, removed in 4.17
- ia64 1103, removed in 6.7
- m32r 99, removed in 4.17
- m68k 99
- microblaze 99
- mn10300 99, removed in 4.17
- parisc 99
- score 1056, removed in 4.17
- sh 99
- sparc 157
- sparc64 157
- tilegx 43, removed in 4.17
- xtensa 184
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/statfs