$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 #else +#ifndef HAVE_SWAPCTL #include /* For struct mapent. */ #endif +#endif #include /* 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 */