fsetxattr on x64
set an extended attribute value
sys_fsetxattr(int fd, const char *name, const void *value, size_t size, int flags)
| number | 190 (0xbe) |
|---|---|
| abi | common |
| entry point | sys_fsetxattr |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | fsetxattr(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 190, the syscall number |
rdi | int fd |
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 228
- arm64 7
- arm 228
- riscv64 7
- ia32 228
- x32 1073742014
- loongarch64 7
- ppc64 211
- ppc 211
- s390x 226
- mips64 5182
- mipsn32 6182
- mipso32 4226
- alpha 384
- arc 7
- blackfin 228, removed in 4.17
- cris 228, removed in 4.17
- csky 7
- frv 228, removed in 4.17
- hexagon 7
- ia64 1219, removed in 6.7
- m32r 228, removed in 4.17
- m68k 225
- metag 7, removed in 4.17
- microblaze 228
- mn10300 228, removed in 4.17
- nds32 7, removed in 5.18
- nios2 7
- openrisc 7
- parisc 240
- score 7, removed in 4.17
- sh 228
- sparc 171
- sparc64 171
- tilegx 7, removed in 4.17
- tilepro 7, removed in 4.17
- xtensa 76
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/fsetxattr