[LTP] [PATCH V3 05/23] guard mallocopt() with __GLIBC__

Khem Raj raj.khem@gmail.com
Fri Jul 22 06:26:38 CEST 2016


mallocopt is not available on non glibc implementations

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 utils/benchmark/ebizzy-0.3/ebizzy.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/utils/benchmark/ebizzy-0.3/ebizzy.c b/utils/benchmark/ebizzy-0.3/ebizzy.c
index 5bb8eff..f9ccc8b 100644
--- a/utils/benchmark/ebizzy-0.3/ebizzy.c
+++ b/utils/benchmark/ebizzy-0.3/ebizzy.c
@@ -215,10 +215,12 @@ static void read_options(int argc, char *argv[])
 			"\"never mmap\" option specified\n");
 		usage();
 	}
-
+#ifdef __GLIBC__
 	if (never_mmap)
 		mallopt(M_MMAP_MAX, 0);
-
+#else
+	fprintf(stderr, "Platform does not support mallopt() API\n");
+#endif
 	if (chunk_size < record_size) {
 		fprintf(stderr, "Chunk size %u smaller than record size %u\n",
 			chunk_size, record_size);
-- 
2.9.0



More information about the ltp mailing list