summaryrefslogtreecommitdiff
path: root/devel/libgtop/files/patch-ah
blob: 8b51deb9addae21cd64635e68530e85fb70b3e6c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
--- sysdeps/freebsd/procmap.c.orig	Mon Nov 26 17:37:59 2001
+++ sysdeps/freebsd/procmap.c	Sat Oct 19 14:07:46 2002
@@ -33,7 +33,11 @@
 #include <sys/proc.h>
 #include <sys/resource.h>
 #include <vm/vm_object.h>
+#if (__FreeBSD_version >= 400011)
+#include <vm/vm.h>
+#else
 #include <vm/vm_prot.h>
+#endif
 #include <vm/vm_map.h>
 
 #include <sys/vnode.h>
@@ -92,7 +96,6 @@
 #if defined __FreeBSD__
 	struct vnode vnode;
 	struct inode inode;
-	struct mount mount;
 #endif
 	int count, i = 0;
 	int update = 0;
@@ -114,7 +117,11 @@
 	/* Now we get the memory maps. */
 
 	if (kvm_read (server->machine.kd,
+#if (__FreeBSD_version >= 500013)
+		      (unsigned long) pinfo [0].ki_vmspace,
+#else
 		      (unsigned long) pinfo [0].kp_proc.p_vmspace,
+#endif
 		      (char *) &vmspace, sizeof (vmspace)) != sizeof (vmspace))
 		glibtop_error_io_r (server, "kvm_read (vmspace)");
 
@@ -217,7 +224,7 @@
 		if (!vnode.v_uvm.u_flags & UVM_VNODE_VALID)
 			continue;
 
-		if ((vnode.v_type != VREG) || (vnode.v_tag != VT_UFS) ||
+		if ((vnode.v_type != VREG) || strcmp("ufs", vnode.v_tag) ||
 		    !vnode.v_data) continue;
 
 		if (kvm_read (server->machine.kd,
@@ -244,18 +251,17 @@
 			      &vnode, sizeof (vnode)) != sizeof (vnode))
 			glibtop_error_io_r (server, "kvm_read (vnode)");
 
+#if __FreeBSD_version >= 500039
+		if ((vnode.v_type != VREG) || strcmp("ufs", vnode.v_tag) ||
+#else
 		if ((vnode.v_type != VREG) || (vnode.v_tag != VT_UFS) ||
+#endif
 		    !vnode.v_data) continue;
 
 		if (kvm_read (server->machine.kd,
 			      (unsigned long) vnode.v_data,
 			      &inode, sizeof (inode)) != sizeof (inode))
 			glibtop_error_io_r (server, "kvm_read (inode)");
-
-		if (kvm_read (server->machine.kd,
-			      (unsigned long) vnode.v_mount,
-			      &mount, sizeof (mount)) != sizeof (mount))
-			glibtop_error_io_r (server, "kvm_read (mount)");
 
 		maps [i-1].inode  = inode.i_number;
 		maps [i-1].device = inode.i_dev;