File tree 3 files changed +36
-0
lines changed
3 files changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -778,6 +778,8 @@ include(CheckFTS)
778
778
include (CheckUnamePosix)
779
779
# Check support for file descriptor passing
780
780
include (CheckFDPassing)
781
+ # Check support for mallinfo memory stats
782
+ include (CheckMallinfo)
781
783
782
784
# Check if big-endian
783
785
include (TestBigEndian)
Original file line number Diff line number Diff line change
1
+ #include <malloc.h>
2
+
3
+ int main ()
4
+ {
5
+ struct mallinfo mi ;
6
+ mi = mallinfo ();
7
+ return 0 ;
8
+ }
Original file line number Diff line number Diff line change
1
+ #
2
+ # Check for mallinfo(3) sys call.
3
+ #
4
+
5
+ GET_FILENAME_COMPONENT (_selfdir_CheckMallinfo
6
+ "${CMAKE_CURRENT_LIST_FILE} " PATH )
7
+
8
+ # Check that the POSIX compliant uname(2) call works properly (HAVE_UNAME_SYSCALL)
9
+ try_run (
10
+ # Name of variable to store the run result (process exit status; number) in:
11
+ test_run_result
12
+ # Name of variable to store the compile result (TRUE or FALSE) in:
13
+ test_compile_result
14
+ # Binary directory:
15
+ ${CMAKE_CURRENT_BINARY_DIR}
16
+ # Source file to be compiled:
17
+ ${_selfdir_CheckMallinfo} /CheckMallinfo.c
18
+ # Where to store the output produced during compilation:
19
+ COMPILE_OUTPUT_VARIABLE test_compile_output
20
+ # Where to store the output produced by running the compiled executable:
21
+ RUN_OUTPUT_VARIABLE test_run_output )
22
+
23
+ # Did compilation succeed and process return 0 (success)?
24
+ if ("${test_compile_result} " AND ("${test_run_result} " EQUAL 0))
25
+ set (HAVE_MALLINFO 1)
26
+ endif ()
You can’t perform that action at this time.
0 commit comments