Compile oprofile tools on the host.
Some of the new build targets are disabled for now because libbfd is
not currently provided by the prebuilt toolchain for all platforms.
Change-Id: Ie2c24bf997c9c5f15f6c3e2eaf949d73578890d8
diff --git a/libdb/db_manage.c b/libdb/db_manage.c
index 17a0be5..5fc6fe9 100644
--- a/libdb/db_manage.c
+++ b/libdb/db_manage.c
@@ -77,12 +77,21 @@
if (ftruncate(data->fd, new_file_size))
return 1;
+#ifdef MISSING_MREMAP
+ new_map = mmap(0, new_file_size, PROT_READ | PROT_WRITE,
+ MAP_SHARED, data->fd, 0);
+#else
new_map = mremap(data->base_memory,
old_file_size, new_file_size, MREMAP_MAYMOVE);
+#endif
if (new_map == MAP_FAILED)
return 1;
+#ifdef MISSING_MREMAP
+ munmap(data->base_memory, old_file_size);
+#endif
+
data->base_memory = new_map;
data->descr = odb_to_descr(data);
data->descr->size *= 2;