summaryrefslogtreecommitdiffstats
path: root/usr.sbin/xntpd/util/tickadj.c
diff options
context:
space:
mode:
authorwollman <wollman@FreeBSD.org>1994-04-03 20:37:34 +0000
committerwollman <wollman@FreeBSD.org>1994-04-03 20:37:34 +0000
commit8871cc86456af7ac2b6aaac295b53fbc833f0e89 (patch)
tree312766d509f6692c70474b147c86e23b0cb7889c /usr.sbin/xntpd/util/tickadj.c
parente443cab17b10edaf34f39653876a52614bf98e94 (diff)
downloadFreeBSD-src-8871cc86456af7ac2b6aaac295b53fbc833f0e89.zip
FreeBSD-src-8871cc86456af7ac2b6aaac295b53fbc833f0e89.tar.gz
Upgraded to Delaware version 3.3p (yes, that's right, they're not increasing).
This version still doesn't talk to the kernel PLL code, but you should be able to convince it to do so relatively easily. Also deleted some junk files and fixed all compilation warnings.
Diffstat (limited to 'usr.sbin/xntpd/util/tickadj.c')
-rw-r--r--usr.sbin/xntpd/util/tickadj.c55
1 files changed, 54 insertions, 1 deletions
diff --git a/usr.sbin/xntpd/util/tickadj.c b/usr.sbin/xntpd/util/tickadj.c
index ab10b37..b3b6ba9 100644
--- a/usr.sbin/xntpd/util/tickadj.c
+++ b/usr.sbin/xntpd/util/tickadj.c
@@ -1,4 +1,4 @@
-/* tickadj.c,v 3.1 1993/07/06 01:11:05 jbj Exp
+/*
* tickadj - read, and possibly modify, the kernel `tick' and
* `tickadj' variables, as well as `dosynctodr'. Note that
* this operates on the running kernel only. I'd like to be
@@ -6,6 +6,41 @@
* mastered this yet.
*/
#include <stdio.h>
+
+#ifdef SYS_LINUX
+#include <sys/timex.h>
+
+struct timex txc;
+
+int
+main(int argc, char ** argv)
+{
+ if (argc > 2)
+ {
+ fprintf(stderr, "Usage: %s [tick_value]\n", argv[0]);
+ exit(-1);
+ }
+ else if (argc == 2)
+ {
+ if ( (txc.tick = atoi(argv[1])) < 1 )
+ {
+ fprintf(stderr, "Silly value for tick: %s\n", argv[1]);
+ exit(-1);
+ }
+ txc.mode = ADJ_TICK;
+ }
+ else
+ txc.mode = 0;
+
+ if (__adjtimex(&txc) < 0)
+ perror("adjtimex");
+ else
+ printf("tick = %d\n", txc.tick);
+
+ return(0);
+}
+#else /* not Linux... kmem tweaking: */
+
#include <sys/types.h>
#include <sys/file.h>
#include <sys/stat.h>
@@ -353,6 +388,22 @@ getoffsets(filex, tick_off, tickadj_off, dosync_off, noprintf_off)
#endif
#endif
+#if defined(SYS_HPUX)
+#define X_TICKADJ 0
+#define X_TICK 1
+#define X_DEF
+ static struct nlist nl[] =
+#ifdef hp9000s300
+ { {"_tickadj"},
+ {"_old_tick"},
+#else
+ { {"tickadj"},
+ {"old_tick"},
+#endif
+ {""},
+ };
+#endif
+
#if !defined(X_DEF)
#define X_TICKADJ 0
#define X_TICK 1
@@ -373,6 +424,7 @@ getoffsets(filex, tick_off, tickadj_off, dosync_off, noprintf_off)
"/kernel/unix",
"/386bsd",
"/netbsd",
+ "/hp-ux",
NULL
};
struct stat stbuf;
@@ -513,3 +565,4 @@ readvar(fd, off, var)
exit(1);
}
}
+#endif /* not Linux */
OpenPOWER on IntegriCloud