lgetxattr on x64
retrieve an extended attribute value
sys_lgetxattr(const char *path, const char *name, void *value, size_t size)
| number | 192 (0xc0) |
|---|---|
| abi | common |
| entry point | sys_lgetxattr |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | lgetxattr(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 192, 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 230
- arm64 9
- arm 230
- riscv64 9
- ia32 230
- x32 1073742016
- loongarch64 9
- ppc64 213
- ppc 213
- s390x 228
- mips64 5184
- mipsn32 6184
- mipso32 4228
- alpha 386
- arc 9
- blackfin 230, removed in 4.17
- cris 230, removed in 4.17
- csky 9
- frv 230, removed in 4.17
- hexagon 9
- ia64 1221, removed in 6.7
- m32r 230, removed in 4.17
- m68k 227
- metag 9, removed in 4.17
- microblaze 230
- mn10300 230, removed in 4.17
- nds32 9, removed in 5.18
- nios2 9
- openrisc 9
- parisc 242
- score 9, removed in 4.17
- sh 230
- sparc 173
- sparc64 173
- tilegx 9, removed in 4.17
- tilepro 9, removed in 4.17
- xtensa 73
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/lgetxattr