fix the prototype of settimeofday to follow the original BSD declaration
[musl] / src / time / clock.c
1 #include <time.h>
2 #include <sys/times.h>
3 #include "syscall.h"
4
5 int __clock_gettime(clockid_t, struct timespec *);
6
7 clock_t clock()
8 {
9         struct timespec ts;
10         struct tms tms;
11         if (!__clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &ts))
12                 return ts.tv_sec*1000000 + ts.tv_nsec/1000;
13         __syscall(SYS_times, &tms);
14         return (tms.tms_utime + tms.tms_stime)*10000;
15 }