diff -urN ucd-snmp-4.2.6/agent/mibgroup/host/hr_swrun.c ucd-snmp/agent/mibgroup/host/hr_swrun.c
--- ucd-snmp-4.2.6/agent/mibgroup/host/hr_swrun.c	Sun Mar 24 08:19:10 2002
+++ u7/agent/mibgroup/host/hr_swrun.c	Fri Jun  4 01:13:42 2004
@@ -545,7 +545,11 @@
 	    strcpy(string, proc_buf->p_user.u_comm);
 #endif
 #elif HAVE_KVM_GETPROCS
+    #if defined(freebsd5)
+            strcpy(string, proc_table[LowProcIndex].ki_comm);
+    #else
             strcpy(string, proc_table[LowProcIndex].kp_proc.p_comm);
+    #endif
 #elif defined(linux)
 	    sprintf( string, "/proc/%d/status", pid );
 	    if ((fp = fopen( string, "r")) == NULL) return NULL;
@@ -640,7 +644,11 @@
 	    *cp1 = 0;
 #endif
 #elif HAVE_KVM_GETPROCS
+    #if defined(freebsd5)
+            strcpy(string, proc_table[LowProcIndex].ki_comm);
+    #else
             strcpy(string, proc_table[LowProcIndex].kp_proc.p_comm);
+    #endif
 #elif defined(linux)
 	    sprintf( string, "/proc/%d/cmdline", pid );
 	    if ((fp = fopen( string, "r")) == NULL) return NULL;
@@ -815,7 +823,11 @@
 	    }
 #else
 #if HAVE_KVM_GETPROCS
+    #if defined(freebsd5)
+	    switch ( proc_table[LowProcIndex].ki_stat ) {
+    #else
 	    switch ( proc_table[LowProcIndex].kp_proc.p_stat ) {
+    #endif
 #elif defined(dynix)
 	    switch ( lowpsinfo.pr_state ) {
 #elif defined(solaris2)
@@ -911,9 +923,13 @@
 	    		  proc_buf->p_stime*100;
 #endif
 #elif HAVE_KVM_GETPROCS
+    #if defined(freebsd5)
+        long_return = proc_table[LowProcIndex].ki_runtime / 100000;
+    #else
 	    long_return = proc_table[LowProcIndex].kp_proc.p_uticks +
 	    		  proc_table[LowProcIndex].kp_proc.p_sticks +
 	    		  proc_table[LowProcIndex].kp_proc.p_iticks;
+    #endif
 #elif defined(linux)
 	    sprintf( string, "/proc/%d/stat", pid );
 	    if ((fp = fopen( string, "r")) == NULL) return NULL;
@@ -980,7 +996,11 @@
 #endif
 #elif HAVE_KVM_GETPROCS
 #if defined(freebsd3) && !defined(darwin)
+   #if defined(freebsd5)
+	    long_return = proc_table[LowProcIndex].ki_size / 1024;
+   #else
 	    long_return = proc_table[LowProcIndex].kp_eproc.e_vm.vm_map.size/1024;
+   #endif
 #else
 	    long_return = proc_table[LowProcIndex].kp_eproc.e_vm.vm_tsize +
 			  proc_table[LowProcIndex].kp_eproc.e_vm.vm_ssize +
@@ -1242,8 +1262,13 @@
 #elif defined(solaris2)
 	return proc_table[current_proc_entry++];
 #elif HAVE_KVM_GETPROCS
+    #if defined(freebsd5)
+        if (proc_table[current_proc_entry].ki_stat != 0)
+            return proc_table[current_proc_entry++].ki_pid;
+    #else
 	if ( proc_table[current_proc_entry].kp_proc.p_stat != 0 )
 	    return proc_table[current_proc_entry++].kp_proc.p_pid;
+    #endif
 #else
 	if ( proc_table[current_proc_entry].p_stat != 0 )
 	    return proc_table[current_proc_entry++].p_pid;

