Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 8 Jun 1997 18:12:26 +0200 (SAT)
From:      John Hay <jhay@zibbi.mikom.csir.co.za>
To:        hackers@FreeBSD.ORG (FreeBSD-hackers)
Subject:   Proposed change to struct clockinfo
Message-ID:  <199706081612.SAA12095@zibbi.mikom.csir.co.za>

next in thread | raw e-mail | index | archive | help
Hi,

I have tried to compile the latest version of xntpd (3-5.90.1) on FreeBSD,
but the compile breaks because it assume that the clockinfo structure
have an element tickadj. Both NetBSD and OpenBSD have it. I would like
to add it to our source also, but want to hear if there is any complaints,
or something that I have missed.

Four files have to change:
sys/sys/time.h
sys/kern/kern_clock.c
lib/libc/gen/sysctl.3
usr.sbin/sysctl/sysctl.c

As far as I can tell only 4 other files use the clockinfo structure and
they will work again after a recompile. They are:
lib/libc/gmon/gmon.c
usr.bin/time/time.c
usr.sbin/kgmon/kgmon.c
libexec/rpc.rstatd/rstat_proc.c

I would also like to put these in the 2.2 tree after a few days.

If I don't hear anything in the next few days, I will assume it means yes. :-)

John
--
John Hay -- John.Hay@mikom.csir.co.za

--- sys/sys/time.h.org	Tue May 13 18:38:11 1997
+++ sys/sys/time.h	Sun Jun  8 17:34:22 1997
@@ -125,6 +125,7 @@
 struct clockinfo {
 	int	hz;		/* clock frequency */
 	int	tick;		/* micro-seconds per hz tick */
+	int	tickadj;	/* clock skew rate for adjtime() */
 	int	stathz;		/* statistics clock frequency */
 	int	profhz;		/* profiling clock frequency */
 };
--- sys/kern/kern_clock.c.org	Sun Jun  8 17:31:24 1997
+++ sys/kern/kern_clock.c	Sun Jun  8 17:32:43 1997
@@ -1048,6 +1048,7 @@
 	 */
 	clkinfo.hz = hz;
 	clkinfo.tick = tick;
+	clkinfo.tickadj = tickadj;
 	clkinfo.profhz = profhz;
 	clkinfo.stathz = stathz ? stathz : hz;
 	return (sysctl_handle_opaque(oidp, &clkinfo, sizeof clkinfo, req));
--- lib/libc/gen/sysctl.3.org	Sat Mar 15 16:52:46 1997
+++ lib/libc/gen/sysctl.3	Sun Jun  8 17:37:30 1997
@@ -294,7 +294,7 @@
 .Va struct clockinfo
 structure is returned.
 This structure contains the clock, statistics clock and profiling clock
-frequencies, and the number of micro-seconds per hz tick.
+frequencies, the number of micro-seconds per hz tick and the slew rate.
 .It Li KERN_FILE
 Return the entire file table.
 The returned data consists of a single
--- usr.sbin/sysctl/sysctl.c.org	Fri Apr  4 18:42:54 1997
+++ usr.sbin/sysctl/sysctl.c	Sun Jun  8 17:39:48 1997
@@ -222,8 +222,8 @@
 	struct clockinfo *ci = (struct clockinfo*)p;
 	if (l2 != sizeof *ci)
 		err(-1, "S_clockinfo %d != %d", l2, sizeof *ci);
-	printf("{ hz = %d, tick = %d, profhz = %d, stathz = %d }",
-		ci->hz, ci->tick, ci->profhz, ci->stathz);
+	printf("{ hz = %d, tick = %d, tickadj = %d, profhz = %d, stathz = %d }",
+		ci->hz, ci->tick, ci->tickadj, ci->profhz, ci->stathz);
 	return (0);
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199706081612.SAA12095>