Add support for tracking and logging daemon memory usage.
[sliver-openvswitch.git] / vswitchd / system-stats.c
index b8f8d7e..cecd8f4 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010 Nicira Networks
+/* Copyright (c) 2010 Nicira, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -95,7 +95,11 @@ get_memory_stats(struct shash *stats)
     if (!LINUX) {
         unsigned int pagesize = get_page_size();
         long int phys_pages = sysconf(_SC_PHYS_PAGES);
+#ifdef _SC_AVPHYS_PAGES
         long int avphys_pages = sysconf(_SC_AVPHYS_PAGES);
+#else
+        long int avphys_pages = 0;
+#endif
         int mem_total, mem_used;
 
         if (pagesize <= 0 || phys_pages <= 0 || avphys_pages <= 0) {