mount_setattr on x64
change properties of a mount or mount tree
sys_mount_setattr(int dfd, const char *path, unsigned int flags, struct mount_attr *uattr, size_t usize)
| number | 442 (0x1ba) |
|---|---|
| abi | common |
| entry point | sys_mount_setattr |
| since | Linux 5.12 |
| man page | mount_setattr(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 442, the syscall number |
rdi | int dfd |
rsi | const char *path |
rdx | unsigned int flags |
r10 | struct mount_attr *uattr |
r8 | size_t usize |
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 442
- arm64 442
- arm 442
- riscv64 442
- ia32 442
- x32 1073742266
- loongarch64 442
- ppc64 442
- ppc 442
- s390x 442
- mips64 5442
- mipsn32 6442
- mipso32 4442
- alpha 552
- arc 442
- csky 442
- hexagon 442
- ia64 1466, removed in 6.7
- m68k 442
- microblaze 442
- nds32 442, removed in 5.18
- nios2 442
- openrisc 442
- parisc 442
- sh 442
- sparc 442
- sparc64 442
- xtensa 442
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/mount_setattr