15 #include <mach/mach.h> 16 #include <mach/clock.h> 18 #define EPICS_EXPOSE_LIBCOM_MONOTONIC_PRIVATE 25 static clock_serv_t host_clock;
33 clock_get_time(host_clock, &mts);
36 *pDest = epicsTime(ts);
42 static int timeRegister(
void)
44 host_get_clock_service(mach_host_self(), CALENDAR_CLOCK, &host_clock);
52 static int done = timeRegister();
57 return gmtime_r(pAnsiTime, pTM) ?
63 return localtime_r(clock, result) ?
67 extern "C" LIBCOM_API
void 75 else if (timeout > 60 * 60 * 24 * 3652.5)
76 timeout = 60 * 60 * 24 * 3652.5;
78 clock_get_time(host_clock, &now);
81 wait.
tv_nsec =
static_cast< long >((timeout - (double)wait.
tv_sec) * 1e9);
85 if (wakeTime->
tv_nsec >= 1000000000L) {
86 wakeTime->
tv_nsec -= 1000000000L;
LIBCOM_API void convertDoubleToWakeTime(double timeout, struct timespec *wakeTime)
#define generalTimeCurrentTpRegister
void osdMonotonicInit(void)
#define epicsTimeOK
Success.
#define LAST_RESORT_PRIORITY
EPICS time stamp, for use from C code.
int osdTimeGetCurrent(epicsTimeStamp *pDest)
Defined by POSIX Real Time.
Routines for code that can't continue or return after an error.
EPICS time-stamps (epicsTimeStamp), epicsTime C++ class and C functions for handling wall-clock times...
int epicsTime_gmtime(const time_t *pAnsiTime, struct tm *pTM)
Break down a time_t into a struct tm in the UTC timezone.
int epicsTime_localtime(const time_t *clock, struct tm *result)
Break down a time_t into a struct tm in the local timezone.