Browse code

core: timer - relocate er_clock_gettime() in cdp module

- benchmark may need it as well

Daniel-Constantin Mierla authored on 06/05/2016 07:07:11
Showing 2 changed files
... ...
@@ -37,7 +37,4 @@ time_t ser_time(time_t* t);
37 37
  * WARNING: ignores tz (it's obsolete anyway) */
38 38
 int ser_gettimeofday(struct timeval* tv, const struct timezone *tz);
39 39
 
40
-/* portable implementation for clock_gettime(CLOCK_REALTIME, ts) */
41
-int ser_clock_gettime(struct timespec *ts);
42
-
43 40
 #endif /* _ser_time_h */
... ...
@@ -38,11 +38,6 @@
38 38
 #include "error.h"
39 39
 #include "signals.h"
40 40
 
41
-#ifdef __OS_darwin
42
-#include <mach/clock.h>
43
-#include <mach/mach.h>
44
-#endif
45
-
46 41
 /*
47 42
 #include "config.h"
48 43
 */
... ...
@@ -1159,22 +1154,4 @@ void slow_timer_main()
1159 1159
 
1160 1160
 }
1161 1161
 
1162
-int ser_clock_gettime(struct timespec *ts)
1163
-{
1164
-#ifdef __OS_darwin
1165
-	clock_serv_t cclock;
1166
-	mach_timespec_t mts;
1167
-
1168
-	/* OS X does not have clock_gettime, use clock_get_time */
1169
-	host_get_clock_service(mach_host_self(), CALENDAR_CLOCK, &cclock);
1170
-	clock_get_time(cclock, &mts);
1171
-	mach_port_deallocate(mach_task_self(), cclock);
1172
-	ts->tv_sec = mts.tv_sec;
1173
-	ts->tv_nsec = mts.tv_nsec;
1174
-	return 0;
1175
-#else
1176
-	return clock_gettime(CLOCK_REALTIME, ts);
1177
-#endif
1178
-}
1179
-
1180 1162
 #endif