lsetxattr on x64
set an extended attribute value
sys_lsetxattr(const char *path, const char *name, const void *value, size_t size, int flags)
| number | 189 (0xbd) |
|---|---|
| abi | common |
| entry point | sys_lsetxattr |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | lsetxattr(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 189, the syscall number |
rdi | const char *path |
rsi | const char *name |
rdx | const void *value |
r10 | size_t size |
r8 | int flags |
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 227
- arm64 6
- arm 227
- riscv64 6
- ia32 227
- x32 1073742013
- loongarch64 6
- ppc64 210
- ppc 210
- s390x 225
- mips64 5181
- mipsn32 6181
- mipso32 4225
- alpha 383
- arc 6
- blackfin 227, removed in 4.17
- cris 227, removed in 4.17
- csky 6
- frv 227, removed in 4.17
- hexagon 6
- ia64 1218, removed in 6.7
- m32r 227, removed in 4.17
- m68k 224
- metag 6, removed in 4.17
- microblaze 227
- mn10300 227, removed in 4.17
- nds32 6, removed in 5.18
- nios2 6
- openrisc 6
- parisc 239
- score 6, removed in 4.17
- sh 227
- sparc 170
- sparc64 170
- tilegx 6, removed in 4.17
- tilepro 6, removed in 4.17
- xtensa 72
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/lsetxattr