time on x64
get time in seconds
sys_time(__kernel_old_time_t *tloc)
| number | 201 (0xc9) |
|---|---|
| abi | common |
| entry point | sys_time |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | time(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 201, the syscall number |
rdi | __kernel_old_time_t *tloc |
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 13
- ia32 13
- x32 1073742025
- ppc64 13
- ppc 13
- mipso32 4013
- blackfin 13, removed in 4.17
- cris 13, removed in 4.17
- frv 13, removed in 4.17
- m32r 13, removed in 4.17
- m68k 13
- microblaze 13
- mn10300 13, removed in 4.17
- parisc 13
- score 1062, removed in 4.17
- sh 13
- sparc 231
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/time