From 8871cc86456af7ac2b6aaac295b53fbc833f0e89 Mon Sep 17 00:00:00 2001 From: wollman Date: Sun, 3 Apr 1994 20:37:34 +0000 Subject: 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. --- usr.sbin/xntpd/util/tickadj.c | 55 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 54 insertions(+), 1 deletion(-) (limited to 'usr.sbin/xntpd/util/tickadj.c') 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 + +#ifdef SYS_LINUX +#include + +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 #include #include @@ -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 */ -- cgit v1.1