$OpenBSD: patch-provider_libserver_ECStatsTables_cpp,v 1.4 2015/11/02 11:06:34 robert Exp $
--- provider/libserver/ECStatsTables.cpp.orig	Wed Aug  5 17:30:47 2015
+++ provider/libserver/ECStatsTables.cpp	Thu Aug 20 12:36:50 2015
@@ -350,15 +350,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;
 	}
 
