futimesat on x64
change timestamps of a file relative to a directory file descriptor
sys_futimesat(int dfd, const char *filename, struct __kernel_old_timeval *utimes)
| number | 261 (0x105) |
|---|---|
| abi | common |
| entry point | sys_futimesat |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | futimesat(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 261, the syscall number |
rdi | int dfd |
rsi | const char *filename |
rdx | 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 299
- arm 326
- ia32 299
- x32 1073742085
- ppc64 290
- ppc 290
- s390x 292
- mips64 5251
- mipsn32 6255
- mipso32 4292
- alpha 454
- blackfin 299, removed in 4.17
- cris 299, removed in 4.17
- frv 299, removed in 4.17
- ia64 1285, removed in 6.7
- m32r 299, removed in 4.17
- m68k 292
- microblaze 299
- mn10300 300, removed in 4.17
- parisc 279
- score 1066, removed in 4.17
- sh 299
- sparc 288
- sparc64 288
- xtensa 298
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/futimesat