16 #define EPICS_EXPOSE_LIBCOM_MONOTONIC_PRIVATE 26 #define TIME_INIT ClockTime_Init(CLOCKTIME_NOSYNC) 30 #define TIME_INIT generalTimeCurrentTpRegister("GetTimeOfDay", \ 31 LAST_RESORT_PRIORITY, osdTimeGetCurrent) 39 if (gettimeofday (&tv, &tz))
42 *pDest = epicsTime(tv);
49 int clock_settime(clockid_t clock,
const timespec *tp)
56 static int timeRegister(
void)
63 static int done = timeRegister();
69 struct tm * pRet = gmtime_r ( pAnsiTime, pTM );
81 struct tm * pRet = localtime_r ( clock, result );
90 extern "C" LIBCOM_API
void 98 else if (timeout > 60 * 60 * 24 * 3652.5)
99 timeout = 60 * 60 * 24 * 3652.5;
101 #ifdef CLOCK_REALTIME 102 status = clock_gettime(CLOCK_REALTIME, &now);
107 status = gettimeofday(&tv, &tz);
109 now.
tv_nsec = tv.tv_usec * 1000;
113 perror(
"convertDoubleToWakeTime");
118 wait.
tv_nsec =
static_cast< long >((timeout - (double)wait.
tv_sec) * 1e9);
122 if (wakeTime->
tv_nsec >= 1000000000L) {
123 wakeTime->
tv_nsec -= 1000000000L;
LIBCOM_API void convertDoubleToWakeTime(double timeout, struct timespec *wakeTime)
void osdMonotonicInit(void)
#define epicsTimeOK
Success.
BSD and SRV5 Unix timestamp.
EPICS time stamp, for use from C code.
LIBCOM_API void cantProceed(const char *msg,...)
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.