sync on x64
commit filesystem caches to disk
sys_sync(void)
| number | 162 (0xa2) |
|---|---|
| abi | common |
| entry point | sys_sync |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | sync(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 162, the syscall number |
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 36
- arm64 81
- arm 36
- riscv64 81
- ia32 36
- x32 1073741986
- loongarch64 81
- ppc64 36
- ppc 36
- s390x 36
- mips64 5157
- mipsn32 6157
- mipso32 4036
- alpha 36
- arc 81
- blackfin 36, removed in 4.17
- cris 36, removed in 4.17
- csky 81
- frv 36, removed in 4.17
- hexagon 81
- ia64 1050, removed in 6.7
- m32r 36, removed in 4.17
- m68k 36
- metag 81, removed in 4.17
- microblaze 36
- mn10300 36, removed in 4.17
- nds32 81, removed in 5.18
- nios2 81
- openrisc 81
- parisc 36
- score 81, removed in 4.17
- sh 36
- sparc 36
- sparc64 36
- tilegx 81, removed in 4.17
- tilepro 81, removed in 4.17
- xtensa 178
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/sync