From 38ebf63961529c87d88defc969ad7bc6dbbacc0a Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 11 Jul 2013 12:39:24 -0400 Subject: [PATCH] Fallback to gettimeofday for access time in FileManager --- libs/pbd/file_manager.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libs/pbd/file_manager.cc b/libs/pbd/file_manager.cc index a71ffca190..72eeeb2524 100644 --- a/libs/pbd/file_manager.cc +++ b/libs/pbd/file_manager.cc @@ -116,10 +116,14 @@ FileManager::allocate (FileDescriptor* d) #ifdef __APPLE__ d->_last_used = mach_absolute_time(); -#else +#elif defined(_POSIX_TIMERS) && defined(_POSIX_MONOTONIC_CLOCK) struct timespec t; clock_gettime (CLOCK_MONOTONIC, &t); d->_last_used = t.tv_sec + (double) t.tv_nsec / 10e9; +#else + struct timeval now; + gettimeofday (&now, NULL); + d->_last_used = now.tv_sec + (double) now.tv_usec / 10e6; #endif d->_refcount++;