#include <sys/types.h>
#include <sys/socket.h>
#include <epicsStdio.h>
#include <rtems.h>
#include <errno.h>
#include <unistd.h>
#include <netinet/in.h>
#include <rtems/rtems_bsdnet_internal.h>
#include "epicsTime.h"
#include "osdTime.h"
#include "osiNTPTime.h"
#include "osiClockTime.h"
#include "generalTimeSup.h"
Go to the source code of this file.
#define EPICS_EXPOSE_LIBCOM_MONOTONIC_PRIVATE |
int epicsTime_gmtime |
( |
const time_t * |
pAnsiTime, |
|
|
struct tm * |
pTM |
|
) |
| |
Break down a time_t
into a struct tm
in the UTC timezone.
Definition at line 120 of file osdTime.cpp.
122 struct tm * pRet = gmtime_r ( pAnsiTime, pTM );
#define epicsTimeOK
Success.
int epicsTime_localtime |
( |
const time_t * |
clock, |
|
|
struct tm * |
result |
|
) |
| |
Break down a time_t
into a struct tm
in the local timezone.
Definition at line 131 of file osdTime.cpp.
133 struct tm * pRet = localtime_r ( clock,
result );
#define epicsTimeOK
Success.
Definition at line 45 of file osdTime.cpp.
47 static unsigned bequiet;
62 ret = recvfrom(ntpSocket, junk,
sizeof(junk), MSG_DONTWAIT,
NULL,
NULL);
63 if (ret == -1 && errno == EAGAIN) {
68 printf(
"osdNTPGet cleaner error: %s\n", strerror(errno));
int rtems_bsdnet_get_ntp(int, int(*)(), struct timespec *)
Definition at line 81 of file osdTime.cpp.
83 struct sockaddr_in myAddr;
85 ntpSocket = socket (AF_INET, SOCK_DGRAM, 0);
87 printf(
"osdNTPInit() Can't create socket: %s\n", strerror (errno));
90 memset (&myAddr, 0,
sizeof myAddr);
91 myAddr.sin_family = AF_INET;
92 myAddr.sin_port = htons (0);
93 myAddr.sin_addr.s_addr = htonl (INADDR_ANY);
94 if (bind (ntpSocket, (
struct sockaddr *)&myAddr,
sizeof myAddr) < 0) {
95 printf(
"osdNTPInit() Can't bind socket: %s\n", strerror (errno));
void osdNTPReport |
( |
void |
| ) |
|
Definition at line 105 of file osdTime.cpp.
108 rtems_clock_get (RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &t);
int osdTickRateGet |
( |
void |
| ) |
|
Definition at line 112 of file osdTime.cpp.
rtems_interval rtemsTicksPerSecond
void osdTimeRegister |
( |
void |
| ) |
|
Definition at line 36 of file osdTime.cpp.
void ClockTime_Init(int synchronize)
void osdMonotonicInit(void)
void NTPTime_Init(int priority)
int rtems_bsdnet_get_ntp |
( |
int |
, |
|
|
int(*)() |
, |
|
|
struct timespec * |
|
|
) |
| |
rtems_interval rtemsTicksPerSecond |
double rtemsTicksPerSecond_double |
double rtemsTicksPerTwoSeconds_double |