#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <unistd.h>
#include "m5op.h"
" m5 dumpstats [delay [period]]\n"
" m5 dumpresetstats [delay [period]]\n"
" m5 checkpoint [delay [period]]\n"
+ " m5 readfile\n"
"\n"
"All times in nanoseconds!\n");
exit(1);
return 0;
}
+ if (COMPARE("readfile")) {
+ char buf[256*1024];
+ int offset = 0;
+ int len;
+
+ if (argc != 2)
+ usage();
+
+ while ((len = m5_readfile(buf, sizeof(buf), offset)) > 0) {
+ write(STDOUT_FILENO, buf, len);
+ offset += len;
+ }
+
+ return 0;
+ }
+
usage();
}