--- sysdeps/freebsd/prockernel.c.orig	Tue Aug 25 16:33:39 1998
+++ sysdeps/freebsd/prockernel.c	Wed Oct  7 23:46:23 1998
@@ -35,6 +35,7 @@
 
 #include <unistd.h>
 #include <fcntl.h>
+#include <osreldate.h>
 
 static const unsigned long _glibtop_sysdeps_proc_kernel_pstats =
 (1 << GLIBTOP_PROC_KERNEL_MIN_FLT) +
@@ -119,9 +120,14 @@
 		       (char *) &pcb, sizeof (pcb)) == sizeof (pcb))
 		{
 			/* Same like with pstats above. */
-			
+#if (__FreeBSD_version >= 300003)
+			buf->kstk_esp = (u_int64_t) pcb.pcb_esp;
+			buf->kstk_eip = (u_int64_t) pcb.pcb_eip;
+#else
 			buf->kstk_esp = (u_int64_t) pcb.pcb_ksp;
 			buf->kstk_eip = (u_int64_t) pcb.pcb_pc;
+#endif
+			
 			
 			buf->flags |= _glibtop_sysdeps_proc_kernel_pcb;
 		}
--- sysdeps/freebsd/proctime.c.orig	Tue Aug 25 16:33:42 1998
+++ sysdeps/freebsd/proctime.c	Thu Oct  8 22:49:48 1998
@@ -19,6 +19,7 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+#include <osreldate.h>
 #include <glibtop.h>
 #include <glibtop/error.h>
 #include <glibtop/proctime.h>
@@ -59,7 +60,9 @@
 {
 	quad_t totusec;
 	u_quad_t u, st, ut, it, tot;
+#if (__FreeBSD_version < 300003)
 	long sec, usec;
+#endif
 	struct timeval tv;
 
 	st = p->p_sticks;
@@ -72,10 +75,14 @@
 		tot = 1;
 	}
 
+#if (__FreeBSD_version >= 300003)
+	totusec = p->p_runtime;
+#else
 	sec = p->p_rtime.tv_sec;
 	usec = p->p_rtime.tv_usec;
 
 	totusec = (quad_t)sec * 1000000 + usec;
+#endif
 	if (totusec < 0) {
 		/* XXX no %qd in kernel.  Truncate. */
 		printf("calcru: negative time: %ld usec\n", (long)totusec);
@@ -151,7 +158,11 @@
 
 	glibtop_suid_leave (server);
 
+#if (__FreeBSD_version >= 300003)
+	buf->rtime = pinfo [0].kp_proc.p_runtime;
+#else
 	buf->rtime = tv2sec (pinfo [0].kp_proc.p_rtime);
+#endif
 
 	buf->frequency = 1000000;
 
