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
|
--- sysdeps/freebsd/procmap.c.orig Wed Mar 10 21:23:52 2004
+++ sysdeps/freebsd/procmap.c Thu Mar 11 16:04:21 2004
@@ -33,7 +33,11 @@
#include <sys/resource.h>
#if defined(__NetBSD__) && (__NetBSD_Version__ < 105020000)
#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>
#elif defined(__NetBSD__) && (__NetBSD_Version__ >= 105020000)
#include <uvm/uvm_extern.h>
@@ -104,7 +108,7 @@
glibtop_map_entry *maps;
#if defined __FreeBSD__
struct vnode vnode;
-#if __FreeBSD_version >= 500039
+#if __FreeBSD_version < 500039
struct inode inode;
#endif
#endif
@@ -122,8 +126,10 @@
/* Get the process data */
pinfo = kvm_getprocs (server->machine.kd, KERN_PROC_PID, pid, &count);
- if ((pinfo == NULL) || (count < 1))
+ if ((pinfo == NULL) || (count < 1)) {
glibtop_error_io_r (server, "kvm_getprocs (%d)", pid);
+ return NULL;
+ }
/* Now we get the memory maps. */
@@ -280,10 +286,6 @@
&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)");
#endif
maps [i-1].inode = inode.i_number;
maps [i-1].device = inode.i_dev;
|