diff options
author | Vladislav Vaintroub <wlad@montyprogram.com> | 2012-01-23 17:12:25 +0100 |
---|---|---|
committer | Vladislav Vaintroub <wlad@montyprogram.com> | 2012-01-23 17:12:25 +0100 |
commit | 19d13a3b17d613c04acbcd8c7a0578a55e0c2938 (patch) | |
tree | 3e68a9b34873bffa9d83a7ab26de6b161a37efc7 /mysys | |
parent | 7baa64fc6182ca2baf3da6888044ef5411b51727 (diff) | |
download | mariadb-git-19d13a3b17d613c04acbcd8c7a0578a55e0c2938.tar.gz |
portability fixes for FreeBSD 8 and 9
Diffstat (limited to 'mysys')
-rw-r--r-- | mysys/my_getsystime.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/mysys/my_getsystime.c b/mysys/my_getsystime.c index ece0c5fdd87..f1caea6d21a 100644 --- a/mysys/my_getsystime.c +++ b/mysys/my_getsystime.c @@ -118,6 +118,7 @@ void my_time_init() ulonglong my_getcputime() { +#ifdef CLOCK_THREAD_CPUTIME_ID #ifdef HAVE_CLOCK_GETTIME struct timespec tp; if (clock_gettime(CLOCK_THREAD_CPUTIME_ID, &tp)) @@ -128,7 +129,8 @@ ulonglong my_getcputime() if (syscall(__NR_clock_gettime, CLOCK_THREAD_CPUTIME_ID, &tp)) return 0; return (ulonglong)tp.tv_sec*10000000+(ulonglong)tp.tv_nsec/100; -#else - return 0; #endif /* HAVE_CLOCK_GETTIME */ +#else /* HAVE_THREAD_CPUTIME_ID */ + return 0; +#endif } |