7 int __vdso_clock_gettime(clockid_t, struct timespec *) __attribute__((weak));
8 static int (*cgt)(clockid_t, struct timespec *) = __vdso_clock_gettime;
10 int __clock_gettime(clockid_t clk, struct timespec *ts)
13 if (cgt) return cgt(clk, ts);
14 r = __syscall(SYS_clock_gettime, clk, ts);
18 if (clk == CLOCK_REALTIME) {
19 __syscall(SYS_gettimeofday, clk, ts, 0);
20 ts->tv_nsec = (int)ts->tv_nsec * 1000;
29 weak_alias(__clock_gettime, clock_gettime);