summaryrefslogtreecommitdiffstats
path: root/net-mgmt/net-snmp53/files/patch-hr_swrun.c
diff options
context:
space:
mode:
Diffstat (limited to 'net-mgmt/net-snmp53/files/patch-hr_swrun.c')
-rw-r--r--net-mgmt/net-snmp53/files/patch-hr_swrun.c68
1 files changed, 34 insertions, 34 deletions
diff --git a/net-mgmt/net-snmp53/files/patch-hr_swrun.c b/net-mgmt/net-snmp53/files/patch-hr_swrun.c
index c232386..a2afd1c 100644
--- a/net-mgmt/net-snmp53/files/patch-hr_swrun.c
+++ b/net-mgmt/net-snmp53/files/patch-hr_swrun.c
@@ -1,43 +1,43 @@
---- agent/mibgroup/host/hr_swrun.c.orig Sat Feb 16 09:41:19 2002
-+++ agent/mibgroup/host/hr_swrun.c Sat Feb 16 23:41:05 2002
-@@ -543,7 +543,11 @@
- strcpy(string, proc_buf->p_user.u_comm);
+--- agent/mibgroup/host/hr_swrun.c.orig Sat Apr 20 16:30:03 2002
++++ agent/mibgroup/host/hr_swrun.c Wed Apr 24 01:43:15 2002
+@@ -557,7 +557,11 @@
+ strcpy(string, proc_buf->p_user.u_comm);
#endif
#elif HAVE_KVM_GETPROCS
+#if defined(freebsd5) && __FreeBSD_version >= 500014
+ strcpy(string, proc_table[LowProcIndex].ki_comm);
+#else
- strcpy(string, proc_table[LowProcIndex].kp_proc.p_comm);
+ 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;
-@@ -638,7 +642,11 @@
- *cp1 = 0;
+ sprintf(string, "/proc/%d/status", pid);
+ if ((fp = fopen(string, "r")) == NULL)
+@@ -662,7 +666,11 @@
+ *cp1 = 0;
#endif
#elif HAVE_KVM_GETPROCS
+#if defined(freebsd5) && __FreeBSD_version >= 500014
+ strcpy(string, proc_table[LowProcIndex].ki_comm);
+#else
- strcpy(string, proc_table[LowProcIndex].kp_proc.p_comm);
+ 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;
-@@ -810,7 +818,11 @@
- }
+ sprintf(string, "/proc/%d/cmdline", pid);
+ if ((fp = fopen(string, "r")) == NULL)
+@@ -853,7 +861,11 @@
+ }
#else
#if HAVE_KVM_GETPROCS
+#if defined(freebsd5) && __FreeBSD_version >= 500014
+ switch ( proc_table[LowProcIndex].ki_stat ) {
+#else
- switch ( proc_table[LowProcIndex].kp_proc.p_stat ) {
+ switch (proc_table[LowProcIndex].kp_proc.p_stat) {
+#endif
#elif defined(dynix)
- switch ( lowpsinfo.pr_state ) {
+ switch (lowpsinfo.pr_state) {
#elif defined(solaris2)
-@@ -906,9 +918,17 @@
- proc_buf->p_stime*100;
+@@ -948,9 +960,17 @@
+ long_return = proc_buf->p_utime * 100 + proc_buf->p_stime * 100;
#endif
#elif HAVE_KVM_GETPROCS
+#if defined(freebsd5) && __FreeBSD_version >= 500014
@@ -47,17 +47,17 @@
+ proc_table[LowProcIndex].ki_paddr->p_iticks; */
+ long_return = 0;
+#else
- long_return = proc_table[LowProcIndex].kp_proc.p_uticks +
- proc_table[LowProcIndex].kp_proc.p_sticks +
- proc_table[LowProcIndex].kp_proc.p_iticks;
+ 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;
-@@ -976,6 +996,13 @@
- #elif HAVE_KVM_GETPROCS
+ sprintf(string, "/proc/%d/stat", pid);
+ if ((fp = fopen(string, "r")) == NULL)
+@@ -1022,6 +1042,13 @@
#if defined(freebsd3) && !defined(darwin)
- long_return = proc_table[LowProcIndex].kp_eproc.e_vm.vm_map.size/1024;
+ long_return =
+ proc_table[LowProcIndex].kp_eproc.e_vm.vm_map.size / 1024;
+#elif defined(freebsd5) && __FreeBSD_version >= 500014
+ /* XXX
+ long_return = proc_table[LowProcIndex].ki_vmspace->vm_tsize +
@@ -66,19 +66,19 @@
+ long_return = long_return * (getpagesize() / 1024); */
+ long_return = 0;
#else
- long_return = proc_table[LowProcIndex].kp_eproc.e_vm.vm_tsize +
- proc_table[LowProcIndex].kp_eproc.e_vm.vm_ssize +
-@@ -1237,8 +1264,13 @@
+ long_return = proc_table[LowProcIndex].kp_eproc.e_vm.vm_tsize +
+ proc_table[LowProcIndex].kp_eproc.e_vm.vm_ssize +
+@@ -1299,8 +1326,13 @@
#elif defined(solaris2)
- return proc_table[current_proc_entry++];
+ return proc_table[current_proc_entry++];
#elif HAVE_KVM_GETPROCS
+#if defined(freebsd5) && __FreeBSD_version >= 500014
+ 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;
+ 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;
+ if (proc_table[current_proc_entry].p_stat != 0)
+ return proc_table[current_proc_entry++].p_pid;
OpenPOWER on IntegriCloud