summaryrefslogtreecommitdiff
path: root/sysutils/lavaps/patches/patch-aa
blob: a6fab2dfcabba4c83354c0d25c1ff35e3d272a69 (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
$NetBSD: patch-aa,v 1.2 2000/02/05 06:54:30 wiz Exp $
--- process_scan_freebsd.cc.orig	Tue Nov  2 16:27:39 1999
+++ process_scan_freebsd.cc	Tue Nov  2 16:53:24 1999
@@ -112,7 +112,7 @@
 	ENTRY_TRACE(__FILE__,__LINE__);
 	static int pages_per_kb = 0;
 	if (!pages_per_kb)
-		pages_per_kb = getpagesize() / 1024;
+		pages_per_kb = sysconf(_SC_PAGESIZE) / 1024;
 	return pages * pages_per_kb;
 }
 
@@ -246,6 +246,16 @@
 	// xxx: skip p_iticks
 
 	int size, resident;
+
+#ifdef __NetBSD__
+#  ifndef UPAGES
+#    ifdef USPACE
+#      define UPAGES	( USPACE / sysconf(_SC_PAGESIZE) )
+#    else /* !USPACE */
+#      error No UPAGES, no USPACE, no fun!
+#    endif /* USPACE */
+#  endif /* !UPAGES */
+#endif /* __NetBSD__ */
 
 #if __FreeBSD__ < 3
 	size = UPAGES + cur_kp_->kp_eproc.e_vm.vm_tsize