aboutsummaryrefslogtreecommitdiffstats
path: root/testing/mongodb/20-fix-libc-version.patch
blob: 1f7b517c94df383c4d2e6e264cc8a26e14c41b1f (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
30
31
32
33
34
35
36
37
38
39
40
41
diff --git a/src/mongo/util/processinfo_linux2.cpp b/src/mongo/util/processinfo_linux2.cpp
index d1ed23a..0c1011e 100644
--- a/src/mongo/util/processinfo_linux.cpp
+++ b/src/mongo/util/processinfo_linux.cpp
@@ -335,6 +335,7 @@ public:
         paths.push_back("/etc/debian_release");
         paths.push_back("/etc/slackware-version");
         paths.push_back("/etc/centos-release");
+        paths.push_back("/etc/alpine-release");
         paths.push_back("/etc/os-release");
 
         for (i = paths.begin(); i != paths.end(); ++i) {
@@ -421,10 +422,10 @@ double ProcessInfo::getSystemMemoryPressurePercentage() {
 
 void ProcessInfo::getExtraInfo(BSONObjBuilder& info) {
     // [dm] i don't think mallinfo works. (64 bit.)  ??
-    struct mallinfo malloc_info =
-        mallinfo();  // structure has same name as function that returns it. (see malloc.h)
-    info.append("heap_usage_bytes",
-                malloc_info.uordblks /*main arena*/ + malloc_info.hblkhd /*mmap blocks*/);
+    //struct mallinfo malloc_info =
+    //    mallinfo();  // structure has same name as function that returns it. (see malloc.h)
+    // TODO: Fix for TC_malloc instance().getStats()
+       info.append("heap_usage_bytes", 0);     
     // docs claim hblkhd is included in uordblks but it isn't
 
     LinuxProc p(_pid);
--- ./src/mongo/util/processinfo_linux.cpp.orig
+++ ./src/mongo/util/processinfo_linux.cpp
@@ -37,8 +37,10 @@
 #include <sys/utsname.h>
 #ifdef __UCLIBC__
 #include <features.h>
-#else
+#elif defined(__GLIBC__)
 #include <gnu/libc-version.h>
+#else
+#define gnu_get_libc_version(x) "unknown"
 #endif
 
 #include "processinfo.h"