summaryrefslogtreecommitdiff
path: root/ntpshmread.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2015-03-01 23:57:01 -0500
committerEric S. Raymond <esr@thyrsus.com>2015-03-01 23:57:01 -0500
commit44b3532e07d2e3790a75ccd5a75f19deefa71e82 (patch)
tree3d1bd2eaf9a5134dbcee9247e5f31343c7e96fde /ntpshmread.c
parent4964c68cf4ebca29d745ba02c4ba3da4a68e9abd (diff)
downloadgpsd-44b3532e07d2e3790a75ccd5a75f19deefa71e82.tar.gz
Implement POSIX clock_gettime(3) for systems that lack it (like Mac OS X).
On Mac OS X it will get proper nanosecond precision; elsewhere, only microseconds. Hides the conformance failure from the rest of the code. All regression tests pass.
Diffstat (limited to 'ntpshmread.c')
-rw-r--r--ntpshmread.c9
1 files changed, 0 insertions, 9 deletions
diff --git a/ntpshmread.c b/ntpshmread.c
index 092e6e95..7a9206e3 100644
--- a/ntpshmread.c
+++ b/ntpshmread.c
@@ -74,16 +74,7 @@ enum segstat_t shm_query(/*@null@*/struct shmTime *shm_in, /*@out@*/struct shm_s
/*@-type@*//* splint is confused about struct timespec */
shm_stat->tvc.tv_sec = shm_stat->tvc.tv_nsec = 0;
-#ifdef HAVE_CLOCK_GETTIME
clock_gettime(CLOCK_REALTIME, &shm_stat->tvc);
-#else
- {
- struct timeval tv;
- (void)gettimeofday(&tv, NULL);
- shm_stat->tvc.tv_sec = tv.tv_sec;
- shm_stat->tvc.tv_nsec = tv.tv_usec * 1000;
- }
-#endif
/* relying on word access to be atomic here */
if (shm->valid == 0) {