utimes on x64
change file last access and modification times
sys_utimes(char *filename, struct __kernel_old_timeval *utimes)
| number | 235 (0xeb) |
|---|---|
| abi | common |
| entry point | sys_utimes |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | utimes(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 235, the syscall number |
rdi | char *filename |
rsi | struct __kernel_old_timeval *utimes |
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 271
- arm 269
- ia32 271
- x32 1073742059
- ppc64 251
- ppc 251
- s390x 313
- mips64 5226
- mipsn32 6230
- mipso32 4267
- alpha 363
- blackfin 272, removed in 4.17
- cris 271, removed in 4.17
- frv 271, removed in 4.17
- ia64 1036, removed in 6.7
- m32r 271, removed in 4.17
- m68k 266
- microblaze 271
- mn10300 271, removed in 4.17
- parisc 336
- score 1037, removed in 4.17
- sh 271
- sparc 138
- sparc64 138
- xtensa 65
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/utimes