Support clock_gettime() on OSX El Capitan and earlier

This commit is contained in:
Christian Göttsche
2020-12-13 13:16:44 +01:00
committed by BenBE
parent 0401df8cbd
commit 26993d2d2b
4 changed files with 41 additions and 3 deletions

View File

@ -10,8 +10,8 @@ in the source distribution for its full text.
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "Compat.h"
#include "CRT.h"
#include "Hashtable.h"
#include "Macros.h"
@ -538,8 +538,8 @@ void ProcessList_scan(ProcessList* this, bool pauseProcessUpdate) {
if (!firstScanDone) {
this->scanTs = 0;
firstScanDone = true;
} else if (clock_gettime(CLOCK_MONOTONIC, &now) == 0) {
this->scanTs = now.tv_sec;
} else if (Compat_clock_monotonic_gettime(&now) == 0) {
this->scanTs = now.tv_sec + now.tv_nsec / 1000000000;
}
ProcessList_goThroughEntries(this, false);