summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--perform/perf_meta.c5
-rw-r--r--perform/zip_perf.c24
2 files changed, 15 insertions, 14 deletions
diff --git a/perform/perf_meta.c b/perform/perf_meta.c
index b3966d6..8c3b06f 100644
--- a/perform/perf_meta.c
+++ b/perform/perf_meta.c
@@ -20,9 +20,6 @@
* Purpose: Tests performance of metadata
*/
-#include <stdlib.h>
-#include <string.h>
-#include <sys/time.h>
#include "h5test.h"
#ifdef H5_HAVE_PARALLEL
@@ -685,7 +682,7 @@ double retrieve_time(void)
if(facc_type == FACC_DEFAULT) {
#endif /*H5_HAVE_PARALLEL*/
struct timeval t;
- gettimeofday(&t, NULL);
+ HDgettimeofday(&t, NULL);
return ((double)t.tv_sec + (double)t.tv_usec / 1000000);
#ifdef H5_HAVE_PARALLEL
} else {
diff --git a/perform/zip_perf.c b/perform/zip_perf.c
index d1d36b4..7d96405 100644
--- a/perform/zip_perf.c
+++ b/perform/zip_perf.c
@@ -28,14 +28,15 @@
#include <errno.h>
#include <fcntl.h>
#include <math.h>
-#include <sys/time.h>
#include <sys/types.h>
#include <sys/stat.h>
-#include <unistd.h>
+
+#ifdef H5_HAVE_UNISTD_H
+# include <unistd.h>
+#endif
/* our header files */
-#include "hdf5.h"
-#include "H5private.h"
+#include "h5test.h"
#include "h5tools_utils.h"
#ifdef H5_HAVE_FILTER_DEFLATE
@@ -86,6 +87,9 @@
#define FALSE (!TRUE)
#endif /* FALSE */
+#ifndef S_IRWXU
+#define S_IRWXU (_S_IREAD|_S_IWRITE)
+#endif
/* internal variables */
static const char *prog;
@@ -214,9 +218,9 @@ write_file(Bytef *source, uLongf sourceLen)
if (!dest)
error("out of memory");
- gettimeofday(&timer_start, NULL);
+ HDgettimeofday(&timer_start, NULL);
compress_buffer(dest, &destLen, source, sourceLen);
- gettimeofday(&timer_stop, NULL);
+ HDgettimeofday(&timer_stop, NULL);
compression_time += ((double)timer_stop.tv_sec +
((double)timer_stop.tv_usec) / MICROSECOND) -
@@ -508,7 +512,7 @@ do_write_test(unsigned long file_size, unsigned long min_buf_size,
printf("\n");
/* do uncompressed data write */
- gettimeofday(&timer_start, NULL);
+ HDgettimeofday(&timer_start, NULL);
output = HDopen(filename, O_RDWR | O_CREAT, S_IRWXU);
if (output == -1)
@@ -534,7 +538,7 @@ do_write_test(unsigned long file_size, unsigned long min_buf_size,
}
close(output);
- gettimeofday(&timer_stop, NULL);
+ HDgettimeofday(&timer_stop, NULL);
total_time = ((double)timer_stop.tv_sec +
((double)timer_stop.tv_usec) / MICROSECOND) -
@@ -554,13 +558,13 @@ do_write_test(unsigned long file_size, unsigned long min_buf_size,
error(strerror(errno));
report_once_flag = 1;
- gettimeofday(&timer_start, NULL);
+ HDgettimeofday(&timer_start, NULL);
for (total_len = 0; total_len < file_size; total_len += src_len)
write_file(src, src_len);
close(output);
- gettimeofday(&timer_stop, NULL);
+ HDgettimeofday(&timer_stop, NULL);
total_time = ((double)timer_stop.tv_sec +
((double)timer_stop.tv_usec) / MICROSECOND) -