sysfs on x64
get filesystem type information
sys_sysfs(int option, unsigned long arg1, unsigned long arg2)
| number | 139 (0x8b) |
|---|---|
| abi | common |
| entry point | sys_sysfs |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | sysfs(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 139, the syscall number |
rdi | int option |
rsi | unsigned long arg1 |
rdx | unsigned long arg2 |
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 135
- arm 135
- ia32 135
- x32 1073741963
- ppc64 135
- ppc 135
- s390x 135
- mips64 5136
- mipsn32 6136
- mipso32 4135
- alpha 254
- arc 247
- cris 135, removed in 4.17
- frv 135, removed in 4.17
- ia64 1139, removed in 6.7
- m32r 135, removed in 4.17
- m68k 135
- microblaze 135
- mn10300 135, removed in 4.17
- parisc 135
- sh 135
- sparc 226
- sparc64 226
- xtensa 182
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/sysfs