[BusyBox] [PATCH] ifndef PAGE_SHIFT

Atsushi Nemoto anemo at mba.ocn.ne.jp
Fri Dec 19 04:31:36 UTC 2003


Hi.  libbb/procps.c uses PAGE_SHIFT but recent MIPS kernel headers
does not provide it for userland (because now mips-linux kernel
supports PAGESIZE other than 4K).

This is a quick fix.

--- busybox-1.00-pre4.org/libbb/procps.c	Thu Jul  3 19:07:01 2003
+++ busybox-1.00-pre4/libbb/procps.c	Fri Dec 19 13:20:08 2003
@@ -115,7 +115,11 @@
 		else
 			curstatus.state[2] = ' ';
 
+#ifdef PAGE_SHIFT
 		curstatus.rss <<= (PAGE_SHIFT - 10);     /* 2**10 = 1kb */
+#else
+		curstatus.rss *= (getpagesize() >> 10);     /* 2**10 = 1kb */
+#endif
 
 		if(save_user_arg0) {
 			sprintf(status, "/proc/%d/cmdline", pid);
---
Atsushi Nemoto



More information about the busybox mailing list