Index: /trunk/src/VBox/Runtime/r3/posix/thread-posix.cpp
===================================================================
--- /trunk/src/VBox/Runtime/r3/posix/thread-posix.cpp	(revision 35849)
+++ /trunk/src/VBox/Runtime/r3/posix/thread-posix.cpp	(revision 35850)
@@ -41,4 +41,11 @@
 # include <sys/resource.h>
 #endif
+#if defined(RT_OS_DARWIN)
+# include <mach/thread_act.h>
+# include <mach/thread_info.h>
+# include <mach/host_info.h>
+# include <mach/mach_init.h>
+# include <mach/mach_host.h>
+#endif
 
 #include <iprt/thread.h>
@@ -423,5 +430,5 @@
     *pUserTime   = ts.ru_utime.tv_sec * 1000 + ts.ru_utime.tv_usec / 1000;
     return VINF_SUCCESS;
-#elif !defined(RT_OS_DARWIN)
+#elif defined(RT_OS_LINUX) || defined(RT_OS_FREEBSD)
     /* on Linux, getrusage(RUSAGE_THREAD, ...) is available since 2.6.26 */
     struct timespec ts;
@@ -433,4 +440,16 @@
     *pUserTime = (uint64_t)ts.tv_sec * 1000 + ts.tv_nsec / 1000000;
     return VINF_SUCCESS;
+#elif defined(RT_OS_DARWIN)
+    thread_basic_info ThreadInfo;
+    mach_msg_type_number_t Count = sizeof(ThreadInfo) / sizeof(int);
+    kern_return_t krc;
+
+    krc = thread_info(mach_thread_self(), THREAD_BASIC_INFO, (thread_info_t)&ThreadInfo, &Count);
+    Assert(krc == KERN_SUCCESS);
+
+    *pKernelTime = ThreadInfo.system_time.seconds * 1000 + ThreadInfo.system_time.microseconds / 1000;
+    *pUserTime   = ThreadInfo.user_time.seconds * 1000 + ThreadInfo.user_time.microseconds / 1000;;
+
+    return VINF_SUCCESS;
 #else
     return VERR_NOT_IMPLEMENTED;
