ustat on x64
get filesystem statistics
sys_ustat(unsigned dev, struct ustat *ubuf)
| number | 136 (0x88) |
|---|---|
| abi | common |
| entry point | sys_ustat |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | ustat(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 136, the syscall number |
rdi | unsigned dev |
rsi | struct ustat *ubuf |
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 62
- arm 62
- ia32 62
- x32 1073741960
- ppc64 62
- ppc 62
- s390x 62
- mips64 5133
- mipsn32 6133
- mipso32 4062
- alpha 327
- blackfin 62, removed in 4.17
- cris 62, removed in 4.17
- frv 62, removed in 4.17
- ia64 1069, removed in 6.7
- m32r 62, removed in 4.17
- m68k 62
- microblaze 62
- mn10300 62, removed in 4.17
- parisc 62
- score 1070, removed in 4.17
- sh 62
- sparc 168
- sparc64 168
- xtensa 183
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/ustat