openbsd-ports/devel/libgtop2/patches/patch-sysdeps_freebsd_procmap_c
2005-05-25 23:28:16 +00:00

63 lines
2.1 KiB
Plaintext

--- sysdeps/freebsd/procmap.c.orig Wed Feb 23 00:20:45 2005
+++ sysdeps/freebsd/procmap.c Mon Apr 11 19:56:33 2005
@@ -35,7 +35,7 @@
#include <vm/vm_object.h>
#include <vm/vm_prot.h>
#include <vm/vm_map.h>
-#elif defined(__NetBSD__) && (__NetBSD_Version__ >= 105020000)
+#elif defined(__NetBSD__) && (__NetBSD_Version__ >= 105020000) || defined(__OpenBSD__)
#include <uvm/uvm_extern.h>
#else
#include <vm/vm_object.h>
@@ -64,10 +64,12 @@
#endif
#include <sys/sysctl.h>
#if !defined(__NetBSD__) || (__NetBSD_Version__ < 105020000)
-#include <vm/vm.h>
+#include <uvm/uvm.h>
+#else
#endif
-#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000)
+#if defined(__NetBSD__) && \
+ (__NetBSD_Version__ >= 104000000) && (__NetBSD_Version__ < 105020000)
/* Fixme ... */
#undef _KERNEL
#define _UVM_UVM_AMAP_I_H_ 1
@@ -101,7 +103,7 @@ glibtop_get_proc_map_p (glibtop *server,
struct kinfo_proc *pinfo;
struct vm_map_entry entry, *first;
struct vmspace vmspace;
-#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000)
+#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000) || defined(__OpenBSD__)
struct vnode vnode;
struct inode inode;
#else
@@ -187,7 +189,7 @@ glibtop_get_proc_map_p (glibtop *server,
continue;
#endif
#else
-#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000)
+#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000) || defined(__OpenBSD__)
if (UVM_ET_ISSUBMAP (&entry))
continue;
#else
@@ -213,7 +215,7 @@ glibtop_get_proc_map_p (glibtop *server,
i++;
-#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000)
+#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000) || defined(__OpenBSD__)
if (!entry.object.uvm_obj)
continue;
@@ -237,7 +239,7 @@ glibtop_get_proc_map_p (glibtop *server,
glibtop_error_io_r (server, "kvm_read (object)");
#endif
-#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000)
+#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000) || defined(__OpenBSD__)
#if defined(UVM_VNODE_VALID)
if (!vnode.v_uvm.u_flags & UVM_VNODE_VALID)
continue;