summaryrefslogtreecommitdiff
path: root/sysutils/xosview/patches/patch-ah
blob: e807bca1ce250a254ea3065c8c2d07b52aec4096 (plain)
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
$NetBSD: patch-ah,v 1.1 2002/12/11 22:35:56 christos Exp $

--- bsd/swapinternal.cc.orig	Tue Feb 16 09:09:21 1999
+++ bsd/swapinternal.cc	Wed Dec 11 17:33:24 2002
@@ -68,8 +68,10 @@
 #ifdef XOSVIEW_FREEBSD
 #include <sys/rlist.h>
 #else
+#ifndef HAVE_SWAPCTL
 #include <sys/map.h>		/*  For struct mapent.  */
 #endif
+#endif
 
 #include <kvm.h>		/*  For all sorts of stuff.  */
 #ifndef HAVE_SWAPCTL
@@ -118,10 +120,12 @@
 #ifdef XOSVIEW_FREEBSD
 static struct rlisthdr swaplist;
 #else
+#ifndef HAVE_SWAPCTL
 static int nswapmap;
 static struct map *swapmap, *kswapmap;
 static struct mapent *mp;
 #endif
+#endif
 static int nfree;
 
 #define SVAR(var) __STRING(var) /* to force expansion */
@@ -174,6 +178,7 @@
 	KGET1(VM_SWDEVT, &ptr, sizeof ptr, "swdevt");
 	KGET2(ptr, sw, (signed) (nswdev * sizeof(*sw)), "*swdevt");
 #else /* XOSVIEW_FREEBSD */
+#ifndef HAVE_SWAPCTL
         KGET(VM_NSWAPMAP, nswapmap);
         KGET(VM_SWAPMAP, kswapmap);     /* kernel `swapmap' is a pointer */
         if ((sw = (struct swdevt*) malloc(nswdev * sizeof(*sw))) == NULL ||
@@ -184,6 +189,9 @@
                 return (0);
         }
         KGET1(VM_SWDEVT, sw, (signed) (nswdev * sizeof(*sw)), "swdevt");
+#else
+	return(0);
+#endif
 #endif /* XOSVIEW_FREEBSD */
         once = 1;
         return (1);
@@ -243,6 +251,7 @@
 void
 fetchswap()
 {
+#ifndef HAVE_SWAPCTL
         int s, e, i;
         int elast;
 	struct mapent* localmp;
@@ -299,6 +308,7 @@
                         s = bound;
                 }
         }
+#endif
 }
 #endif /* XOSVIEW_FREEBSD */