diff --git a/eng/native/tryrun.browser.cmake b/eng/native/tryrun.browser.cmake index 86e28c9dd2c9a1..60438de23a0fab 100644 --- a/eng/native/tryrun.browser.cmake +++ b/eng/native/tryrun.browser.cmake @@ -130,9 +130,6 @@ set(HAVE_CFSETSPEED 1 CACHE INTERNAL "") set(HAVE_CHMOD 1 CACHE INTERNAL "") set(HAVE_CLOCK_GETTIME_NSEC_NP "" CACHE INTERNAL "") set(HAVE_CLOCK_MONOTONIC_COARSE 1 CACHE INTERNAL "") -set(HAVE_CLOCK_MONOTONIC_COMPILED TRUE CACHE INTERNAL "") -set_cache_value(HAVE_CLOCK_MONOTONIC_EXITCODE 0) -set(HAVE_CLOCK_MONOTONIC 1 CACHE INTERNAL "") set(HAVE_CLOCK_THREAD_CPUTIME_COMPILED TRUE CACHE INTERNAL "") set_cache_value(HAVE_CLOCK_THREAD_CPUTIME_EXITCODE 255) set(HAVE_CLOCK_THREAD_CPUTIME "" CACHE INTERNAL "") diff --git a/eng/native/tryrun.cmake b/eng/native/tryrun.cmake index 32ce86cc0fae94..2090f8a618d3d8 100644 --- a/eng/native/tryrun.cmake +++ b/eng/native/tryrun.cmake @@ -54,7 +54,6 @@ if(DARWIN AND NOT DEFINED ANDROID_BUILD) set_cache_value(HAVE_BROKEN_FIFO_KEVENT_EXITCODE 1) set_cache_value(HAVE_BROKEN_FIFO_SELECT_EXITCODE 1) set_cache_value(HAVE_CLOCK_MONOTONIC_COARSE_EXITCODE 1) - set_cache_value(HAVE_CLOCK_MONOTONIC_EXITCODE 0) set_cache_value(HAVE_CLOCK_REALTIME_EXITCODE 0) set_cache_value(HAVE_CLOCK_THREAD_CPUTIME_EXITCODE 0) set_cache_value(HAVE_CLOCK_GETTIME_NSEC_NP_EXITCODE 0) @@ -75,7 +74,6 @@ if(DARWIN AND NOT DEFINED ANDROID_BUILD) endif() else() set_cache_value(HAVE_CLOCK_MONOTONIC_COARSE_EXITCODE 0) - set_cache_value(HAVE_CLOCK_MONOTONIC_EXITCODE 0) set_cache_value(HAVE_CLOCK_REALTIME_EXITCODE 0) set_cache_value(HAVE_CLOCK_THREAD_CPUTIME_EXITCODE 0) set_cache_value(HAVE_MMAP_DEV_ZERO_EXITCODE 0) @@ -96,7 +94,6 @@ else() if (FREEBSD) set_cache_value(HAVE_SHM_OPEN_THAT_WORKS_WELL_ENOUGH_WITH_MMAP 1) - set_cache_value(HAVE_CLOCK_MONOTONIC 1) set_cache_value(HAVE_CLOCK_REALTIME 1) set_cache_value(HAVE_BROKEN_FIFO_KEVENT_EXITCODE 1) set_cache_value(HAVE_PROCFS_STAT 0) diff --git a/eng/native/tryrun_ios_tvos.cmake b/eng/native/tryrun_ios_tvos.cmake index 7b98f6dcd055ef..fa8af4020363a8 100644 --- a/eng/native/tryrun_ios_tvos.cmake +++ b/eng/native/tryrun_ios_tvos.cmake @@ -5,7 +5,6 @@ endmacro() set_cache_value(HAVE_SCHED_GETCPU_EXITCODE 1) set_cache_value(HAVE_CLOCK_MONOTONIC_COARSE_EXITCODE 1) -set_cache_value(HAVE_CLOCK_MONOTONIC_EXITCODE 0) # TODO: these are taken from macOS, check these whether they're correct for iOS diff --git a/src/coreclr/pal/src/config.h.in b/src/coreclr/pal/src/config.h.in index a30f661035d1c4..49795de0a3dc41 100644 --- a/src/coreclr/pal/src/config.h.in +++ b/src/coreclr/pal/src/config.h.in @@ -87,7 +87,6 @@ #cmakedefine01 HAVE_WORKING_GETTIMEOFDAY #cmakedefine01 HAVE_WORKING_CLOCK_GETTIME #cmakedefine01 HAVE_CLOCK_THREAD_CPUTIME -#cmakedefine01 HAVE_CLOCK_MONOTONIC #cmakedefine01 HAVE_PTHREAD_CONDATTR_SETCLOCK #cmakedefine01 MMAP_ANON_IGNORES_PROTECTION #cmakedefine01 ONE_SHARED_MAPPING_PER_FILEREGION_PER_PROCESS diff --git a/src/coreclr/pal/src/configure.cmake b/src/coreclr/pal/src/configure.cmake index 9acda1fcb12e09..f0687feb656c85 100644 --- a/src/coreclr/pal/src/configure.cmake +++ b/src/coreclr/pal/src/configure.cmake @@ -366,21 +366,7 @@ int main() }" HAVE_WORKING_CLOCK_GETTIME) set(CMAKE_REQUIRED_LIBRARIES) -set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_RT_LIBS}) -check_cxx_source_runs(" -#include -#include -#include - -int main() -{ - int ret; - struct timespec ts; - ret = clock_gettime(CLOCK_MONOTONIC, &ts); - exit(ret); -}" HAVE_CLOCK_MONOTONIC) -set(CMAKE_REQUIRED_LIBRARIES) check_library_exists(${PTHREAD_LIBRARY} pthread_condattr_setclock "" HAVE_PTHREAD_CONDATTR_SETCLOCK) diff --git a/src/coreclr/pal/src/synchmgr/synchmanager.cpp b/src/coreclr/pal/src/synchmgr/synchmanager.cpp index b6c44754210805..4aec8e0067ca33 100644 --- a/src/coreclr/pal/src/synchmgr/synchmanager.cpp +++ b/src/coreclr/pal/src/synchmgr/synchmanager.cpp @@ -386,7 +386,7 @@ namespace CorUnix if (dwTimeout != INFINITE) { // Calculate absolute timeout - palErr = GetAbsoluteTimeout(dwTimeout, &tsAbsTmo, /*fPreferMonotonicClock*/ TRUE); + palErr = GetAbsoluteTimeout(dwTimeout, &tsAbsTmo); if (NO_ERROR != palErr) { ERROR("Failed to convert timeout to absolute timeout\n"); @@ -1051,7 +1051,7 @@ namespace CorUnix ptnwdWorkerThreadNativeData = &pSynchManager->m_pthrWorker->synchronizationInfo.m_tnwdNativeData; - palErr = GetAbsoluteTimeout(WorkerThreadTerminationTimeout, &tsAbsTmo, /*fPreferMonotonicClock*/ TRUE); + palErr = GetAbsoluteTimeout(WorkerThreadTerminationTimeout, &tsAbsTmo); if (NO_ERROR != palErr) { ERROR("Failed to convert timeout to absolute timeout\n"); @@ -2671,7 +2671,7 @@ namespace CorUnix VolatileStore(pdwWaitState, TWS_ACTIVE); m_tsThreadState = TS_STARTING; -#if HAVE_CLOCK_MONOTONIC && HAVE_PTHREAD_CONDATTR_SETCLOCK +#if HAVE_PTHREAD_CONDATTR_SETCLOCK attrsPtr = &attrs; iRet = pthread_condattr_init(&attrs); if (0 != iRet) @@ -2699,7 +2699,7 @@ namespace CorUnix pthread_condattr_destroy(&attrs); goto IPrC_exit; } -#endif // HAVE_CLOCK_MONOTONIC && HAVE_PTHREAD_CONDATTR_SETCLOCK +#endif // HAVE_PTHREAD_CONDATTR_SETCLOCK iEagains = 0; Mutex_retry: @@ -2990,31 +2990,25 @@ namespace CorUnix Converts a relative timeout to an absolute one. --*/ - PAL_ERROR CPalSynchronizationManager::GetAbsoluteTimeout(DWORD dwTimeout, struct timespec * ptsAbsTmo, BOOL fPreferMonotonicClock) + PAL_ERROR CPalSynchronizationManager::GetAbsoluteTimeout(DWORD dwTimeout, struct timespec * ptsAbsTmo) { PAL_ERROR palErr = NO_ERROR; int iRet; -#if HAVE_CLOCK_MONOTONIC && HAVE_PTHREAD_CONDATTR_SETCLOCK - if (fPreferMonotonicClock) +#if HAVE_PTHREAD_CONDATTR_SETCLOCK + iRet = clock_gettime(CLOCK_MONOTONIC, ptsAbsTmo); +#elif HAVE_WORKING_CLOCK_GETTIME + // Not every platform implements a (working) clock_gettime + iRet = clock_gettime(CLOCK_REALTIME, ptsAbsTmo); +#elif HAVE_WORKING_GETTIMEOFDAY + // Not every platform implements a (working) gettimeofday + struct timeval tv; + iRet = gettimeofday(&tv, NULL); + if (0 == iRet) { - iRet = clock_gettime(CLOCK_MONOTONIC, ptsAbsTmo); + ptsAbsTmo->tv_sec = tv.tv_sec; + ptsAbsTmo->tv_nsec = tv.tv_usec * tccMicroSecondsToNanoSeconds; } - else - { -#endif -#if HAVE_WORKING_CLOCK_GETTIME - // Not every platform implements a (working) clock_gettime - iRet = clock_gettime(CLOCK_REALTIME, ptsAbsTmo); -#elif HAVE_WORKING_GETTIMEOFDAY - // Not every platform implements a (working) gettimeofday - struct timeval tv; - iRet = gettimeofday(&tv, NULL); - if (0 == iRet) - { - ptsAbsTmo->tv_sec = tv.tv_sec; - ptsAbsTmo->tv_nsec = tv.tv_usec * tccMicroSecondsToNanoSeconds; - } #else #ifdef DBI_COMPONENT_MONO return ERROR_INTERNAL_ERROR; @@ -3022,9 +3016,6 @@ namespace CorUnix #error "Don't know how to get hi-res current time on this platform" #endif #endif // HAVE_WORKING_CLOCK_GETTIME, HAVE_WORKING_GETTIMEOFDAY -#if HAVE_CLOCK_MONOTONIC && HAVE_PTHREAD_CONDATTR_SETCLOCK - } -#endif if (0 == iRet) { ptsAbsTmo->tv_sec += dwTimeout / tccSecondsToMilliSeconds; diff --git a/src/coreclr/pal/src/synchmgr/synchmanager.hpp b/src/coreclr/pal/src/synchmgr/synchmanager.hpp index 4a577261a783b0..32939732a5ff9e 100644 --- a/src/coreclr/pal/src/synchmgr/synchmanager.hpp +++ b/src/coreclr/pal/src/synchmgr/synchmanager.hpp @@ -775,8 +775,7 @@ namespace CorUnix static PAL_ERROR GetAbsoluteTimeout( DWORD dwTimeout, - struct timespec * ptsAbsTmo, - BOOL fPreferMonotonicClock); + struct timespec * ptsAbsTmo); }; } diff --git a/src/mono/cmake/config.h.in b/src/mono/cmake/config.h.in index b5224211265cdb..4fe413349369af 100644 --- a/src/mono/cmake/config.h.in +++ b/src/mono/cmake/config.h.in @@ -260,8 +260,6 @@ /* Define to 1 if you have the `sigaction' function. */ #cmakedefine HAVE_SIGACTION 1 -/* CLOCK_MONOTONIC */ -#cmakedefine HAVE_CLOCK_MONOTONIC 1 /* clockid_t */ #cmakedefine HAVE_CLOCKID_T 1 diff --git a/src/mono/cmake/configure.cmake b/src/mono/cmake/configure.cmake index 6b9e021f1437bc..e7daccb7af7675 100644 --- a/src/mono/cmake/configure.cmake +++ b/src/mono/cmake/configure.cmake @@ -112,7 +112,6 @@ check_function_exists(clock_gettime HAVE_CLOCK_GETTIME) check_symbol_exists(madvise "sys/mman.h" HAVE_MADVISE) check_symbol_exists(pthread_mutexattr_setprotocol "pthread.h" HAVE_DECL_PTHREAD_MUTEXATTR_SETPROTOCOL) -check_symbol_exists(CLOCK_MONOTONIC "time.h" HAVE_CLOCK_MONOTONIC) check_symbol_exists(sys_signame "signal.h" HAVE_SYSSIGNAME) check_symbol_exists(pthread_jit_write_protect_np "pthread.h" HAVE_PTHREAD_JIT_WRITE_PROTECT_NP) diff --git a/src/mono/mono/eventpipe/ep-rt-mono.c b/src/mono/mono/eventpipe/ep-rt-mono.c index a6ea9092673d29..60efe175faf07d 100644 --- a/src/mono/mono/eventpipe/ep-rt-mono.c +++ b/src/mono/mono/eventpipe/ep-rt-mono.c @@ -386,15 +386,6 @@ static const int64_t SECS_BETWEEN_1601_AND_1970_EPOCHS = 11644473600LL; static const int64_t SECS_TO_100NS = 10000000; static const int64_t MSECS_TO_MIS = 1000; -/* clock_gettime () is found by configure on Apple builds, but its only present from ios 10, macos 10.12, tvos 10 and watchos 3 */ -#if defined (HAVE_CLOCK_MONOTONIC) && (defined(HOST_IOS) || defined(HOST_OSX) || defined(HOST_WATCHOS) || defined(HOST_TVOS)) -#undef HAVE_CLOCK_MONOTONIC -#endif - -#ifndef HAVE_CLOCK_MONOTONIC -static const int64_t MISECS_TO_NS = 1000; -#endif - static int64_t system_time_to_int64 ( @@ -466,15 +457,9 @@ system_time_to_int64 ( int64_t ep_rt_mono_system_timestamp_get (void) { -#if HAVE_CLOCK_MONOTONIC struct timespec time; if (clock_gettime (CLOCK_REALTIME, &time) == 0) return system_time_to_int64 (time.tv_sec, time.tv_nsec); -#else - struct timeval time; - if (gettimeofday (&time, NULL) == 0) - return system_time_to_int64 (time.tv_sec, time.tv_usec * MISECS_TO_NS); -#endif else return system_time_to_int64 (0, 0); } diff --git a/src/mono/mono/utils/mono-time.c b/src/mono/mono/utils/mono-time.c index cf5c07fc688b22..db0bc074970491 100644 --- a/src/mono/mono/utils/mono-time.c +++ b/src/mono/mono/utils/mono-time.c @@ -190,7 +190,7 @@ mono_clock_get_time_ns (mono_clock_id_t clk_id) void mono_clock_init (mono_clock_id_t *clk_id) { -#ifdef HAVE_CLOCK_MONOTONIC +#ifdef CLOCK_MONOTONIC *clk_id = CLOCK_MONOTONIC; #endif } diff --git a/src/native/libs/Common/pal_config.h.in b/src/native/libs/Common/pal_config.h.in index 32176492bf488c..898516d20d55c3 100644 --- a/src/native/libs/Common/pal_config.h.in +++ b/src/native/libs/Common/pal_config.h.in @@ -97,7 +97,6 @@ #cmakedefine01 HAVE_LINUX_ERRQUEUE_H #cmakedefine01 HAVE_GETDOMAINNAME_SIZET #cmakedefine01 HAVE_INOTIFY -#cmakedefine01 HAVE_CLOCK_MONOTONIC #cmakedefine01 HAVE_CLOCK_REALTIME #cmakedefine01 HAVE_CLOCK_GETTIME_NSEC_NP #cmakedefine01 HAVE_PTHREAD_CONDATTR_SETCLOCK diff --git a/src/native/libs/System.Native/pal_crossprocessmutex.c b/src/native/libs/System.Native/pal_crossprocessmutex.c index aba44eb633a5d0..0d18731c6e9f8c 100644 --- a/src/native/libs/System.Native/pal_crossprocessmutex.c +++ b/src/native/libs/System.Native/pal_crossprocessmutex.c @@ -41,7 +41,7 @@ static int32_t AcquirePThreadMutexWithTimeout(pthread_mutex_t* mutex, int32_t ti timeoutTimeSpec.tv_nsec = (timeoutMilliseconds % 1000) * 1000 * 1000; error = pthread_mutex_reltimedlock_np(mutex, &timeoutTimeSpec); -#elif HAVE_PTHREAD_MUTEX_CLOCKLOCK && HAVE_CLOCK_MONOTONIC +#elif HAVE_PTHREAD_MUTEX_CLOCKLOCK error = clock_gettime(CLOCK_MONOTONIC, &timeoutTimeSpec); assert(error == 0); diff --git a/src/native/libs/System.Native/pal_threading.c b/src/native/libs/System.Native/pal_threading.c index db6133d49df6b9..3085ff6b23a57a 100644 --- a/src/native/libs/System.Native/pal_threading.c +++ b/src/native/libs/System.Native/pal_threading.c @@ -64,7 +64,7 @@ LowLevelMonitor* SystemNative_LowLevelMonitor_Create(void) return NULL; } -#if HAVE_PTHREAD_CONDATTR_SETCLOCK && HAVE_CLOCK_MONOTONIC +#if HAVE_PTHREAD_CONDATTR_SETCLOCK pthread_condattr_t conditionAttributes; error = pthread_condattr_init(&conditionAttributes); if (error != 0) @@ -176,7 +176,7 @@ int32_t SystemNative_LowLevelMonitor_TimedWait(LowLevelMonitor *monitor, int32_t error = pthread_cond_timedwait_relative_np(&monitor->Condition, &monitor->Mutex, &timeoutTimeSpec); #else -#if HAVE_PTHREAD_CONDATTR_SETCLOCK && HAVE_CLOCK_MONOTONIC +#if HAVE_PTHREAD_CONDATTR_SETCLOCK error = clock_gettime(CLOCK_MONOTONIC, &timeoutTimeSpec); assert(error == 0); #else diff --git a/src/native/libs/configure.cmake b/src/native/libs/configure.cmake index 4a697287d3bd54..ee95e1ca6e2a4b 100644 --- a/src/native/libs/configure.cmake +++ b/src/native/libs/configure.cmake @@ -558,28 +558,24 @@ if(CLR_CMAKE_TARGET_IOS) # Manually set results from check_c_source_runs() since it's not possible to actually run it during CMake configure checking unset(HAVE_SHM_OPEN_THAT_WORKS_WELL_ENOUGH_WITH_MMAP) unset(HAVE_ALIGNED_ALLOC) # only exists on iOS 13+ - set(HAVE_CLOCK_MONOTONIC 1) set(HAVE_CLOCK_REALTIME 1) unset(HAVE_FORK) # exists but blocked by kernel elseif(CLR_CMAKE_TARGET_MACCATALYST) # Manually set results from check_c_source_runs() since it's not possible to actually run it during CMake configure checking unset(HAVE_SHM_OPEN_THAT_WORKS_WELL_ENOUGH_WITH_MMAP) unset(HAVE_ALIGNED_ALLOC) # only exists on iOS 13+ - set(HAVE_CLOCK_MONOTONIC 1) set(HAVE_CLOCK_REALTIME 1) unset(HAVE_FORK) # exists but blocked by kernel elseif(CLR_CMAKE_TARGET_TVOS) # Manually set results from check_c_source_runs() since it's not possible to actually run it during CMake configure checking unset(HAVE_SHM_OPEN_THAT_WORKS_WELL_ENOUGH_WITH_MMAP) unset(HAVE_ALIGNED_ALLOC) # only exists on iOS 13+ - set(HAVE_CLOCK_MONOTONIC 1) set(HAVE_CLOCK_REALTIME 1) unset(HAVE_FORK) # exists but blocked by kernel elseif(CLR_CMAKE_TARGET_ANDROID) # Manually set results from check_c_source_runs() since it's not possible to actually run it during CMake configure checking unset(HAVE_SHM_OPEN_THAT_WORKS_WELL_ENOUGH_WITH_MMAP) unset(HAVE_ALIGNED_ALLOC) # only exists on newer Android - set(HAVE_CLOCK_MONOTONIC 1) set(HAVE_CLOCK_REALTIME 1) elseif(CLR_CMAKE_TARGET_WASI) set(HAVE_FORK 0) @@ -617,21 +613,6 @@ else() " HAVE_SHM_OPEN_THAT_WORKS_WELL_ENOUGH_WITH_MMAP) - check_c_source_runs( - " - #include - #include - #include - int main(void) - { - int ret; - struct timespec ts; - ret = clock_gettime(CLOCK_MONOTONIC, &ts); - exit(ret); - return 0; - } - " - HAVE_CLOCK_MONOTONIC) check_c_source_runs( " diff --git a/src/native/minipal/configure.cmake b/src/native/minipal/configure.cmake index 9acaac6ddcc356..65a33a2568d70e 100644 --- a/src/native/minipal/configure.cmake +++ b/src/native/minipal/configure.cmake @@ -13,7 +13,6 @@ check_function_exists(fsync HAVE_FSYNC) check_symbol_exists(arc4random_buf "stdlib.h" HAVE_ARC4RANDOM_BUF) check_symbol_exists(getrandom "sys/random.h" HAVE_GETRANDOM) check_symbol_exists(O_CLOEXEC fcntl.h HAVE_O_CLOEXEC) -check_symbol_exists(CLOCK_MONOTONIC time.h HAVE_CLOCK_MONOTONIC) check_symbol_exists(CLOCK_MONOTONIC_COARSE time.h HAVE_CLOCK_MONOTONIC_COARSE) check_symbol_exists(clock_gettime_nsec_np time.h HAVE_CLOCK_GETTIME_NSEC_NP) diff --git a/src/native/minipal/minipalconfig.h.in b/src/native/minipal/minipalconfig.h.in index 84a619fc8c4096..8b72efb5b23207 100644 --- a/src/native/minipal/minipalconfig.h.in +++ b/src/native/minipal/minipalconfig.h.in @@ -8,7 +8,6 @@ #cmakedefine01 HAVE_RESOURCE_H #cmakedefine01 HAVE_O_CLOEXEC #cmakedefine01 HAVE_SYSCTLBYNAME -#cmakedefine01 HAVE_CLOCK_MONOTONIC #cmakedefine01 HAVE_CLOCK_MONOTONIC_COARSE #cmakedefine01 HAVE_CLOCK_GETTIME_NSEC_NP #cmakedefine01 BIGENDIAN diff --git a/src/native/minipal/time.c b/src/native/minipal/time.c index 26ee0a7613cd9c..3f1d7c1259f4a6 100644 --- a/src/native/minipal/time.c +++ b/src/native/minipal/time.c @@ -97,17 +97,13 @@ int64_t minipal_hires_ticks(void) { #if HAVE_CLOCK_GETTIME_NSEC_NP return (int64_t)clock_gettime_nsec_np(CLOCK_UPTIME_RAW); -#elif HAVE_CLOCK_MONOTONIC +#else struct timespec ts; - int result = clock_gettime(CLOCK_MONOTONIC, &ts); - if (result != 0) - { - assert(!"clock_gettime(CLOCK_MONOTONIC) failed"); - } + int result; + result = clock_gettime(CLOCK_MONOTONIC, &ts); + assert(result == 0 && "clock_gettime(CLOCK_MONOTONIC) failed"); return ((int64_t)(ts.tv_sec) * (int64_t)(tccSecondsToNanoSeconds)) + (int64_t)(ts.tv_nsec); -#else - #error "minipal_hires_ticks requires clock_gettime_nsec_np or clock_gettime to be supported." #endif } @@ -115,7 +111,7 @@ int64_t minipal_lowres_ticks(void) { #if HAVE_CLOCK_GETTIME_NSEC_NP return (int64_t)clock_gettime_nsec_np(CLOCK_UPTIME_RAW) / (int64_t)(tccMilliSecondsToNanoSeconds); -#elif HAVE_CLOCK_MONOTONIC +#else struct timespec ts; // emscripten exposes CLOCK_MONOTONIC_COARSE but doesn't implement it @@ -129,19 +125,15 @@ int64_t minipal_lowres_ticks(void) const clockid_t clockType = CLOCK_MONOTONIC; #endif - int result = clock_gettime(clockType, &ts); - if (result != 0) - { + int result; + result = clock_gettime(clockType, &ts); #if HAVE_CLOCK_MONOTONIC_COARSE && !defined(__EMSCRIPTEN__) - assert(!"clock_gettime(CLOCK_MONOTONIC_COARSE) failed"); + assert(result == 0 && "clock_gettime(CLOCK_MONOTONIC_COARSE) failed"); #else - assert(!"clock_gettime(CLOCK_MONOTONIC) failed"); + assert(result == 0 && "clock_gettime(CLOCK_MONOTONIC) failed"); #endif - } return ((int64_t)(ts.tv_sec) * (int64_t)(tccSecondsToMilliSeconds)) + ((int64_t)(ts.tv_nsec) / (int64_t)(tccMilliSecondsToNanoSeconds)); -#else - #error "minipal_lowres_ticks requires clock_gettime_nsec_np or clock_gettime to be supported." #endif }