o created tsStamp.h

o include tsStamp.h into tsDefs.h
o use assert() instead of C++ exceptions on certain os
This commit is contained in:
Jeff Hill
1999-12-22 23:12:51 +00:00
parent 7a6bc4e1df
commit fa2a1395a0
6 changed files with 308 additions and 121 deletions
+20 -13
View File
@@ -3,24 +3,31 @@
#define epicsExportSharedSymbols
#include "osiTime.h"
//
// osiTime::synchronize()
//
void osiTime::synchronize()
{
}
//
// osiTime::osdGetCurrent ()
//
osiTime osiTime::osdGetCurrent ()
extern "C" epicsShareFunc int tsStampGetCurrent (TS_STAMP *pDest)
{
struct timespec ts;
int status;
struct timespec ts;
status = clock_gettime(CLOCK_REALTIME, &ts);
if (status!=0) {
throw unableToFetchCurrentTime ();
status = clock_gettime (CLOCK_REALTIME, &ts);
if (status) {
return -1;
}
*pDest = osiTime (ts);
return 0;
}
//
// tsStampGetEvent ()
//
extern "C" epicsShareFunc int epicsShareAPI tsStampGetEvent (TS_STAMP *pDest, unsigned eventNumber)
{
if (eventNumber==tsStampEventCurrentTime) {
return tsStampGetCurrent (pDest);
}
else {
return tsStampERROR;
}
return osiTime (ts);
}