summaryrefslogtreecommitdiffstats
path: root/m4/ax_c_mallinfo.m4
diff options
context:
space:
mode:
authorFederico Ceratto <federico.ceratto@gmail.com>2016-11-23 15:49:10 +0000
committerFederico Ceratto <federico.ceratto@gmail.com>2016-11-23 15:49:10 +0000
commit87649cf32bd0e14d5a903fb85b01e9f41a253540 (patch)
treebbefda6dac074aeb87529592e8e5064f69cbe024 /m4/ax_c_mallinfo.m4
parentImported Upstream version 1.3.0+dfsg (diff)
downloadnetdata-87649cf32bd0e14d5a903fb85b01e9f41a253540.tar.xz
netdata-87649cf32bd0e14d5a903fb85b01e9f41a253540.zip
New upstream version 1.4.0+dfsgupstream/1.4.0+dfsg
Diffstat (limited to 'm4/ax_c_mallinfo.m4')
-rwxr-xr-xm4/ax_c_mallinfo.m424
1 files changed, 24 insertions, 0 deletions
diff --git a/m4/ax_c_mallinfo.m4 b/m4/ax_c_mallinfo.m4
new file mode 100755
index 000000000..af8d0481e
--- /dev/null
+++ b/m4/ax_c_mallinfo.m4
@@ -0,0 +1,24 @@
+# AC_C_MALLINFO
+# -------------
+# Define HAVE_C_MALLINFO if mallinfo() works.
+AN_IDENTIFIER([mallinfo], [AC_C_MALLINFO])
+AC_DEFUN([AC_C_MALLINFO],
+[AC_CACHE_CHECK([for mallinfo], ac_cv_c_mallinfo,
+[AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <malloc.h>]],
+ [[
+ struct mallinfo mi = mallinfo();
+ /* make sure that fields exists */
+ mi.uordblks = 0;
+ mi.hblkhd = 0;
+ mi.arena = 0;
+ ]]
+ )],
+ [ac_cv_c_mallinfo=yes],
+ [ac_cv_c_mallinfo=no])])
+if test $ac_cv_c_mallinfo = yes; then
+ AC_DEFINE([HAVE_C_MALLINFO], 1,
+ [Define to 1 if glibc mallinfo exists.])
+fi
+])# AC_C_MALLINFO