aboutsummaryrefslogtreecommitdiff
path: root/benchmarks
diff options
context:
space:
mode:
Diffstat (limited to 'benchmarks')
-rw-r--r--benchmarks/ChangeLog9
-rw-r--r--benchmarks/forks.c18
2 files changed, 13 insertions, 14 deletions
diff --git a/benchmarks/ChangeLog b/benchmarks/ChangeLog
deleted file mode 100644
index a46fe1e8..00000000
--- a/benchmarks/ChangeLog
+++ /dev/null
@@ -1,9 +0,0 @@
-Wed Apr 12 11:25:25 1995 Michael I Bushnell <mib@duality.gnu.ai.mit.edu>
-
- * Makefile (OBJS): New var.
-
-Tue Apr 11 11:17:32 1995 Michael I Bushnell <mib@duality.gnu.ai.mit.edu>
-
- * Makefile: Rewrote in accordance with new scheme.
-
-
diff --git a/benchmarks/forks.c b/benchmarks/forks.c
index 2bb98a88..ed8e53e1 100644
--- a/benchmarks/forks.c
+++ b/benchmarks/forks.c
@@ -1,5 +1,11 @@
/* From 4.4 BSD sys/tests/benchmarks/forks.c. */
+#include <unistd.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <time.h>
+#include <sys/wait.h>
+
/*
* Benchmark program to calculate fork+wait
* overhead (approximately). Process
@@ -8,15 +14,17 @@
* in calculating exec overhead.
*/
+int
main(argc, argv)
+ int argc;
char *argv[];
{
register int nforks, i;
char *cp;
int pid, child, status, brksize;
- int starttime, endtime;
+ time_t starttime, endtime;
- if (argc < 2) {
+ if (argc < 3) {
printf("usage: %s number-of-forks sbrk-size\n", argv[0]);
exit(1);
}
@@ -30,10 +38,10 @@ main(argc, argv)
printf("%s: bad size to sbrk\n", argv[2]);
exit(3);
}
-
+
time (&starttime);
cp = (char *)sbrk(brksize);
- if ((int)cp == -1) {
+ if (cp == (void *)-1) {
perror("sbrk");
exit(4);
}
@@ -51,6 +59,6 @@ main(argc, argv)
;
}
time (&endtime);
- printf ("Time: %d seconds.\n", endtime - starttime);
+ printf ("Time: %d seconds.\n", (int) (endtime - starttime));
exit(0);
}