void-packages/srcpkgs/mongodb/patches/musl-libc_version_h.patch

41 lines
1.4 KiB
Diff
Raw Normal View History

2016-01-12 15:33:17 +01:00
--- src/mongo/util/processinfo_linux.cpp.orig 2015-12-14 14:47:03.364085899 +0100
+++ src/mongo/util/processinfo_linux.cpp 2015-12-14 14:49:57.772093896 +0100
@@ -35,7 +35,7 @@
2015-08-27 00:54:48 +02:00
#include <unistd.h>
#include <sys/mman.h>
#include <sys/utsname.h>
2016-01-12 15:33:17 +01:00
-#ifdef __UCLIBC__
+#ifndef __GLIBC__
#include <features.h>
#else
#include <gnu/libc-version.h>
@@ -424,12 +424,14 @@ double ProcessInfo::getSystemMemoryPress
2015-08-27 00:54:48 +02:00
}
void ProcessInfo::getExtraInfo(BSONObjBuilder& info) {
+#if defined(__GLIBC__)
// [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*/);
// docs claim hblkhd is included in uordblks but it isn't
+#endif
LinuxProc p(_pid);
2016-01-12 15:33:17 +01:00
if (p._maj_flt <= std::numeric_limits<long long>::max())
@@ -467,11 +469,11 @@ void ProcessInfo::SystemInfo::collectSys
2015-08-27 00:54:48 +02:00
BSONObjBuilder bExtra;
bExtra.append("versionString", LinuxSysHelper::readLineFromFile("/proc/version"));
2016-01-12 15:33:17 +01:00
-#ifdef __UCLIBC__
2016-01-12 15:53:21 +01:00
+#if defined(__UCLIBC__)
2016-01-12 15:33:17 +01:00
stringstream ss;
ss << "uClibc-" << __UCLIBC_MAJOR__ << "." << __UCLIBC_MINOR__ << "." << __UCLIBC_SUBLEVEL__;
bExtra.append("libcVersion", ss.str());
-#else
2016-01-12 15:53:21 +01:00
+#elif defined(__GLIBC__)
2015-08-27 00:54:48 +02:00
bExtra.append("libcVersion", gnu_get_libc_version());
2016-01-12 15:33:17 +01:00
#endif
2015-08-27 00:54:48 +02:00
if (!verSig.empty())