*/
#include "dbench.h"
+#include <zlib.h>
#define ival(s) strtol(s, NULL, 0)
char **sparams, **params;
char *p;
const char *status;
- FILE *f;
+ gzFile *gzf;
pid_t parent = getppid();
double targett;
struct child_struct *child;
- f = fopen(loadfile, "r");
- if (f == NULL) {
+ gzf = gzopen(loadfile, "r");
+ if (gzf == NULL) {
perror(loadfile);
exit(1);
}
nb_time_reset(child);
}
- while (fgets(line, sizeof(line)-1, f)) {
+ while (gzgets(gzf, line, sizeof(line)-1)) {
params = sparams;
if (kill(parent, 0) == -1) {
goto done;
}
- rewind(f);
+ gzrewind(gzf);
goto again;
done:
- fclose(f);
+ gzclose(gzf);
for (child=child0;child<child0+options.clients_per_process;child++) {
child->cleanup = 1;
fflush(stdout);
#include "dbench.h"
#include "popt.h"
#include <sys/sem.h>
+#include <zlib.h>
struct options options = {
.backend = "fileio",
static double throughput;
struct nb_operations *nb_ops;
-static FILE *open_loadfile(void)
+static gzFile *open_loadfile(void)
{
- FILE *f;
+ gzFile *f;
- if ((f = fopen(options.loadfile, "rt")) != NULL)
+ if ((f = gzopen(options.loadfile, "rt")) != NULL)
return f;
fprintf(stderr,
int i, status;
int synccount;
struct timeval tv;
- FILE *load;
+ gzFile *load;
struct sembuf sbuf;
double t;