getxattr on x64
retrieve an extended attribute value
sys_getxattr(const char *path, const char *name, void *value, size_t size)
| number | 191 (0xbf) |
|---|---|
| abi | common |
| entry point | sys_getxattr |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | getxattr(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 191, the syscall number |
rdi | const char *path |
rsi | const char *name |
rdx | void *value |
r10 | 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 229
- arm64 8
- arm 229
- riscv64 8
- ia32 229
- x32 1073742015
- loongarch64 8
- ppc64 212
- ppc 212
- s390x 227
- mips64 5183
- mipsn32 6183
- mipso32 4227
- alpha 385
- arc 8
- blackfin 229, removed in 4.17
- cris 229, removed in 4.17
- csky 8
- frv 229, removed in 4.17
- hexagon 8
- ia64 1220, removed in 6.7
- m32r 229, removed in 4.17
- m68k 226
- metag 8, removed in 4.17
- microblaze 229
- mn10300 229, removed in 4.17
- nds32 8, removed in 5.18
- nios2 8
- openrisc 8
- parisc 241
- score 8, removed in 4.17
- sh 229
- sparc 172
- sparc64 172
- tilegx 8, removed in 4.17
- tilepro 8, removed in 4.17
- xtensa 69
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/getxattr