From 7a540261e923915a4708fc2c60a02055ccef9872 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Fri, 1 Oct 1999 17:59:26 +0000 Subject: 1999-10-01 Roland McGrath * forks.c: Add #include's to silence implicit decl warnings (main): Use time_t and add a cast, to silence type warnings. --- benchmarks/forks.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/benchmarks/forks.c b/benchmarks/forks.c index 1043e124..30f01f72 100644 --- a/benchmarks/forks.c +++ b/benchmarks/forks.c @@ -1,5 +1,11 @@ /* From 4.4 BSD sys/tests/benchmarks/forks.c. */ +#include +#include +#include +#include +#include + /* * Benchmark program to calculate fork+wait * overhead (approximately). Process @@ -8,13 +14,14 @@ * in calculating exec overhead. */ +int main(argc, argv) char *argv[]; { register int nforks, i; char *cp; int pid, child, status, brksize; - int starttime, endtime; + time_t starttime, endtime; if (argc < 3) { printf("usage: %s number-of-forks sbrk-size\n", argv[0]); @@ -30,7 +37,7 @@ main(argc, argv) printf("%s: bad size to sbrk\n", argv[2]); exit(3); } - + time (&starttime); cp = (char *)sbrk(brksize); if ((int)cp == -1) { @@ -51,6 +58,6 @@ main(argc, argv) ; } time (&endtime); - printf ("Time: %d seconds.\n", endtime - starttime); + printf ("Time: %d seconds.\n", (int) (endtime - starttime)); exit(0); } -- cgit v1.2.3