patch-2.1.52 linux/fs/proc/array.c

Next file: linux/fs/proc/openpromfs.c
Previous file: linux/fs/nfsd/vfs.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.51/linux/fs/proc/array.c linux/fs/proc/array.c
@@ -295,14 +295,20 @@
 static int get_meminfo(char * buffer)
 {
 	struct sysinfo i;
+	int len;
 
 	si_meminfo(&i);
 	si_swapinfo(&i);
-
+	len = sprintf(buffer, "        total:    used:    free:  shared: buffers:  cached:\n"
+		"Mem:  %8lu %8lu %8lu %8lu %8lu %8lu\n"
+		"Swap: %8lu %8lu %8lu\n",
+		i.totalram, i.totalram-i.freeram, i.freeram, i.sharedram, i.bufferram, page_cache_size*PAGE_SIZE,
+		i.totalswap, i.totalswap-i.freeswap, i.freeswap);
 	/*
-	 * Tagged format, for easy grepping and expansion.
+	 * Tagged format, for easy grepping and expansion. The above will go away
+	 * eventually, once the tools have been updated.
 	 */
-	return sprintf(buffer,
+	return len + sprintf(buffer+len,
 		"MemTotal:  %8lu kB\n"
 		"MemFree:   %8lu kB\n"
 		"MemShared: %8lu kB\n"

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov