$OpenBSD: patch-provider_libserver_ECStatsTables_cpp,v 1.3 2015/04/05 22:25:08 robert Exp $
--- provider/libserver/ECStatsTables.cpp.orig	Thu Mar  5 16:54:01 2015
+++ provider/libserver/ECStatsTables.cpp	Fri Apr  3 23:11:10 2015
@@ -353,15 +353,26 @@ void ECSessionStatsTable::GetSessionData(ECSession *lp
 	// To get up-to-date CPU stats, check each of the active threads on the session
 	// for their CPU usage, and add that to the already-logged time on the session
 	for (iterBS = sd.busystates.begin(); iterBS != sd.busystates.end(); iterBS++) {
+#ifdef OPENBSD
+		struct tms now;
+
+		if(iterBS->threadid == NULL)
+			continue;
+
+		times(&now);
+
+		sd.dblUser += (now.tms_utime / CLOCKS_PER_SEC) - timespec2dbl(iterBS->threadstart);
+#else
 		clockid_t clock;
 		struct timespec now;
-		
+
 		if(pthread_getcpuclockid(iterBS->threadid, &clock) != 0)
 			continue;
-			
+
 		clock_gettime(clock, &now);
-		
+
 		sd.dblUser += timespec2dbl(now) - timespec2dbl(iterBS->threadstart);
+#endif
 		sd.dblReal += GetTimeOfDay() - iterBS->start;
 	}
 
