listxattr on x64
list extended attribute names
sys_listxattr(const char *path, char *list, size_t size)
| number | 194 (0xc2) |
|---|---|
| abi | common |
| entry point | sys_listxattr |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | listxattr(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 194, the syscall number |
rdi | const char *path |
rsi | char *list |
rdx | size_t size |
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 232
- arm64 11
- arm 232
- riscv64 11
- ia32 232
- x32 1073742018
- loongarch64 11
- ppc64 215
- ppc 215
- s390x 230
- mips64 5186
- mipsn32 6186
- mipso32 4230
- alpha 388
- arc 11
- blackfin 232, removed in 4.17
- cris 232, removed in 4.17
- csky 11
- frv 232, removed in 4.17
- hexagon 11
- ia64 1223, removed in 6.7
- m32r 232, removed in 4.17
- m68k 229
- metag 11, removed in 4.17
- microblaze 232
- mn10300 232, removed in 4.17
- nds32 11, removed in 5.18
- nios2 11
- openrisc 11
- parisc 244
- score 11, removed in 4.17
- sh 232
- sparc 178
- sparc64 178
- tilegx 11, removed in 4.17
- tilepro 11, removed in 4.17
- xtensa 70
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/listxattr