summaryrefslogtreecommitdiffstats
path: root/contrib/ntp/include/ntp_unixtime.h
diff options
context:
space:
mode:
authorroberto <roberto@FreeBSD.org>2004-07-20 15:01:56 +0000
committerroberto <roberto@FreeBSD.org>2004-07-20 15:01:56 +0000
commit118e757284cbb8fc4f43a713e892b41504b50a5f (patch)
tree528d12dda44ebdc3ffcc38050f159ac553a69c17 /contrib/ntp/include/ntp_unixtime.h
parenta85d9ae25e8e8696677bc30feb6eaf7fc150e529 (diff)
downloadFreeBSD-src-118e757284cbb8fc4f43a713e892b41504b50a5f.zip
FreeBSD-src-118e757284cbb8fc4f43a713e892b41504b50a5f.tar.gz
Virgin import of ntpd 4.2.0
Diffstat (limited to 'contrib/ntp/include/ntp_unixtime.h')
-rw-r--r--contrib/ntp/include/ntp_unixtime.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/contrib/ntp/include/ntp_unixtime.h b/contrib/ntp/include/ntp_unixtime.h
index bdc080e..ce96980 100644
--- a/contrib/ntp/include/ntp_unixtime.h
+++ b/contrib/ntp/include/ntp_unixtime.h
@@ -5,6 +5,16 @@
#include "ntp_types.h"
+#ifdef SIM
+#include "ntpsim.h"
+#endif
+
+#ifdef SIM
+# define GETTIMEOFDAY(a, b) (node_gettime(&ntp_node, a))
+# define SETTIMEOFDAY(a, b) (node_settime(&ntp_node, a))
+# define ADJTIMEOFDAY(a, b) (node_adjtime(&ntp_node, a, b))
+#else
+# define ADJTIMEOFDAY(a, b) (adjtime(a, b))
/* gettimeofday() takes two args in BSD and only one in SYSV */
# if defined(HAVE_SYS_TIMERS_H) && defined(HAVE_GETCLOCK)
# include <sys/timers.h>
@@ -25,6 +35,7 @@ int getclock (int clock_type, struct timespec *tp);
#endif
# endif /* SYSV_TIMEOFDAY */
# endif /* not (HAVE_SYS_TIMERS_H && HAVE_GETCLOCK) */
+#endif /* SIM */
/*
* Time of day conversion constant. Ntp's time scale starts in 1900,
OpenPOWER on IntegriCloud