[Git][NTPsec/ntpsec][master] Delete fallback to Tru64/HP-UX getclock(2).

Eric S. Raymond gitlab at mg.gitlab.com
Wed Sep 28 05:11:05 UTC 2016


Eric S. Raymond pushed to branch master at NTPsec / ntpsec


Commits:
49c5562f by Eric S. Raymond at 2016-09-28T01:09:31-04:00
Delete fallback to Tru64/HP-UX getclock(2).

All our target systems should have POSIX clock_gettime() or the
deprecated POSIX gettimeofday().

- - - - -


3 changed files:

- libntp/machines.c
- ntpfrob/precision.c
- wafhelpers/configure.py


Changes:

=====================================
libntp/machines.c
=====================================
--- a/libntp/machines.c
+++ b/libntp/machines.c
@@ -29,8 +29,6 @@
 #ifdef __MACH__
 #include <mach/clock.h>
 #include <mach/mach.h>
-#elif HAVE_GETCLOCK
-#include <sys/timers.h>
 #endif
 
 int clock_gettime(clockid_t clk_id, struct timespec *tp)
@@ -55,10 +53,7 @@ int clock_gettime(clockid_t clk_id, struct timespec *tp)
     mach_port_deallocate(mach_task_self(), cclock);
     tp->tv_sec = mts.tv_sec;
     tp->tv_nsec = mts.tv_nsec;
-#elif HAVE_GETCLOCK
-    (void) getclock(TIMEOFDAY, &tp);
-#else
-#error Either POSIX clock_gettime(2) or Tru64/HP-UX getclock(2) is required
+#error POSIX clock_gettime(2) is required
 #endif
     return 0;
 }


=====================================
ntpfrob/precision.c
=====================================
--- a/ntpfrob/precision.c
+++ b/ntpfrob/precision.c
@@ -128,9 +128,6 @@ default_get_precision(void)
 {
 	struct timeval tp;
 	struct timezone tzp;
-#ifdef HAVE_GETCLOCK
-	struct timespec ts;
-#endif
 	long last;
 	int i;
 	long diff;
@@ -139,22 +136,10 @@ default_get_precision(void)
 
 	usec = 0;
 	val = MAXSTEP;
-#ifdef HAVE_GETCLOCK
-	(void) getclock(TIMEOFDAY, &ts);
-	tp.tv_sec = ts.tv_sec;
-	tp.tv_usec = ts.tv_nsec / 1000;
-#else /*  not HAVE_GETCLOCK */
 	gettimeofday(&tp, &tzp);
-#endif /* not HAVE_GETCLOCK */
 	last = tp.tv_usec;
 	for (i = 0; i < MINLOOPS && usec < HUSECS;) {
-#ifdef HAVE_GETCLOCK
-		(void) getclock(TIMEOFDAY, &ts);
-		tp.tv_sec = ts.tv_sec;
-		tp.tv_usec = ts.tv_nsec / 1000;
-#else /*  not HAVE_GETCLOCK */
 		gettimeofday(&tp, &tzp);
-#endif /* not HAVE_GETCLOCK */
 		diff = tp.tv_usec - last;
 		last = tp.tv_usec;
 		if (diff < 0)


=====================================
wafhelpers/configure.py
=====================================
--- a/wafhelpers/configure.py
+++ b/wafhelpers/configure.py
@@ -291,7 +291,6 @@ def cmd_configure(ctx, config):
                 ('clock_gettime', ["time.h"], "RT"),
                 ('clock_settime', ["time.h"], "RT"),
                 ('EVP_MD_do_all_sorted', ["openssl/evp.h"], "CRYPTO"),
-                ('getclock', ["sys/timers.h"]),
 		('getdtablesize', ["unistd.h"]),
                 ('getpassphrase', ["stdlib.h"]),                # Sun systems
                 ('getrusage', ["sys/time.h", "sys/resource.h"]),



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/49c5562f04861378a0275623f472d65eefb2bb19
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ntpsec.org/pipermail/vc/attachments/20160928/bed3d4b2/attachment.html>


More information about the vc mailing list