Signed-off-by: Jarod Wilson <ja...@redhat.com>
---
 hugeadm.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/hugeadm.c b/hugeadm.c
index 5c110cf..21d7d5d 100644
--- a/hugeadm.c
+++ b/hugeadm.c
@@ -73,6 +73,7 @@ extern char *optarg;
 #define MAX_SIZE_MNTENT (64 + PATH_MAX + 32 + 128 + 2 * sizeof(int))
 #define FORMAT_LEN 20
 
+#define MEM_TOTAL "MemTotal:"
 #define SWAP_FREE "SwapFree:"
 #define SWAP_TOTAL "SwapTotal:"
 
@@ -589,6 +590,19 @@ void create_mounts(char *user, char *group, char *base, 
mode_t mode)
 }
 
 /**
+ * show_mem shouldn't change the behavior of any of its
+ * callers, it only prints a message to the user showing the
+ * total amount of memory in the system (in megabytes).
+ */
+void show_mem()
+{
+       long mem_total;
+
+       mem_total = read_meminfo(MEM_TOTAL);
+       printf("Total System Memory: %ld MB\n\n", mem_total / 1024);
+}
+
+/**
  * check_swap shouldn't change the behavior of any of its
  * callers, it only prints a message to the user if something
  * is being done that might fail without swap available.  i.e.
@@ -1003,6 +1017,7 @@ void page_sizes(int all)
 
 void explain()
 {
+       show_mem();
        mounts_list_all();
        printf("\nHuge page pools:\n");
        pool_list();
-- 
1.6.2.5



-- 
Jarod Wilson
ja...@redhat.com

------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
Libhugetlbfs-devel mailing list
Libhugetlbfs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libhugetlbfs-devel

Reply via email to