libxdo
osx_hacks.h
00001 
00002 /* Hack support for clock_gettime into OS X */
00003 
00004 #define CLOCK_MONOTONIC 1
00005 typedef int clockid_t;
00006 int clock_gettime(clockid_t clk_id, struct timespec *res) {
00007   struct timeval tv;
00008   int ret = 0;
00009   ret = gettimeofday(&tv, NULL);
00010   if (ret == 0) {
00011     res->tv_sec = tv.tv_sec;
00012     res->tv_nsec = tv.tv_usec * 1000;
00013   }
00014   return ret;
00015 }
 All Data Structures Files Functions Variables Typedefs