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

40 lines
1.3 KiB
Diff

--- src/mongo/util/processinfo_linux.cpp.orig 2016-12-09 16:19:48.215968681 +0100
+++ src/mongo/util/processinfo_linux.cpp 2016-12-09 16:20:52.402812620 +0100
@@ -40,7 +40,7 @@
#include <sys/mman.h>
#include <sys/utsname.h>
#include <unistd.h>
-#ifdef __UCLIBC__
+#ifndef __GLIBC__
#include <features.h>
#else
#include <gnu/libc-version.h>
@@ -451,11 +451,13 @@ double ProcessInfo::getSystemMemoryPress
}
void ProcessInfo::getExtraInfo(BSONObjBuilder& info) {
+ #if defined(__GLIBC__)
LinuxProc p(_pid);
if (p._maj_flt <= std::numeric_limits<long long>::max())
info.appendNumber("page_faults", static_cast<long long>(p._maj_flt));
else
info.appendNumber("page_faults", static_cast<double>(p._maj_flt));
+ #endif
}
/**
@@ -487,11 +489,11 @@ void ProcessInfo::SystemInfo::collectSys
BSONObjBuilder bExtra;
bExtra.append("versionString", LinuxSysHelper::readLineFromFile("/proc/version"));
-#ifdef __UCLIBC__
+#if defined(__UCLIBC__)
stringstream ss;
ss << "uClibc-" << __UCLIBC_MAJOR__ << "." << __UCLIBC_MINOR__ << "." << __UCLIBC_SUBLEVEL__;
bExtra.append("libcVersion", ss.str());
-#else
+#elif defined(__GLIBC__)
bExtra.append("libcVersion", gnu_get_libc_version());
#endif
if (!verSig.empty())