[libgtop] Support FreeBSD 13.0-CURRENT >= 1300062 vm_map_entry
- From: Robert Roth <robertroth src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgtop] Support FreeBSD 13.0-CURRENT >= 1300062 vm_map_entry
- Date: Sun, 15 Dec 2019 19:11:32 +0000 (UTC)
commit 9b4a03ed0a82a3cbd3086e5352a991759213471b
Author: Neel Chauhan <neel neelc org>
Date: Sun Dec 15 11:06:37 2019 -0500
Support FreeBSD 13.0-CURRENT >= 1300062 vm_map_entry
sysdeps/freebsd/procmap.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
---
diff --git a/sysdeps/freebsd/procmap.c b/sysdeps/freebsd/procmap.c
index ffd88e14..92ae9368 100644
--- a/sysdeps/freebsd/procmap.c
+++ b/sysdeps/freebsd/procmap.c
@@ -273,10 +273,18 @@ glibtop_get_proc_map_p (glibtop *server, glibtop_proc_map *buf,
return NULL;
}
+#if (__FreeBSD_version >= 1300062)
+ first = vmspace.vm_map.header.right;
+#else
first = vmspace.vm_map.header.next;
+#endif
if (kvm_read (server->machine->kd,
+#if (__FreeBSD_version >= 1300062)
+ (gulong) vmspace.vm_map.header.right,
+#else
(gulong) vmspace.vm_map.header.next,
+#endif
(char *) &entry, sizeof (entry)) != sizeof (entry)) {
glibtop_warn_io_r (server, "kvm_read (entry)");
glibtop_suid_leave (server);
@@ -299,7 +307,11 @@ glibtop_get_proc_map_p (glibtop *server, glibtop_proc_map *buf,
if (update) {
if (kvm_read (server->machine->kd,
+#if (__FreeBSD_version >= 1300062)
+ (gulong) entry.right,
+#else
(gulong) entry.next,
+#endif
(char *) &entry, sizeof (entry)) != sizeof (entry)) {
glibtop_warn_io_r (server, "kvm_read (entry)");
continue;
@@ -377,7 +389,11 @@ glibtop_get_proc_map_p (glibtop *server, glibtop_proc_map *buf,
if (entry.protection & VM_PROT_EXECUTE)
mentry->perm |= GLIBTOP_MAP_PERM_EXECUTE;
+#if (__FreeBSD_version >= 1300062)
+ } while (entry.right != first);
+#else
} while (entry.next != first);
+#endif
glibtop_suid_leave (server);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]