summaryrefslogtreecommitdiff
path: root/benchmarks/bonnie/patches
diff options
context:
space:
mode:
authormrg <mrg@pkgsrc.org>2011-08-14 08:35:35 +0000
committermrg <mrg@pkgsrc.org>2011-08-14 08:35:35 +0000
commit9e3211bcb1b96069921477aa4ce1e1ad6aadcb08 (patch)
treedd036a305ebae647767fec451ee39f7e7cf69492 /benchmarks/bonnie/patches
parentcfbdbc01b7f77f89759057ea501cc5c5e0ba46af (diff)
downloadpkgsrc-9e3211bcb1b96069921477aa4ce1e1ad6aadcb08.tar.gz
fix build with GCC 4.5.
Diffstat (limited to 'benchmarks/bonnie/patches')
-rw-r--r--benchmarks/bonnie/patches/patch-ac44
1 files changed, 30 insertions, 14 deletions
diff --git a/benchmarks/bonnie/patches/patch-ac b/benchmarks/bonnie/patches/patch-ac
index 9cc5276dce3..f171c40c662 100644
--- a/benchmarks/bonnie/patches/patch-ac
+++ b/benchmarks/bonnie/patches/patch-ac
@@ -1,16 +1,27 @@
-$NetBSD: patch-ac,v 1.3 2006/04/12 10:55:49 drochner Exp $
+$NetBSD: patch-ac,v 1.4 2011/08/14 08:35:35 mrg Exp $
---- bonnie.c.orig Wed Aug 28 12:23:49 1996
-+++ bonnie.c Tue Apr 29 23:22:39 2003
-@@ -25,6 +25,7 @@
+--- bonnie.c.orig 1996-08-28 09:23:49.000000000 -0700
++++ bonnie.c 2011-08-14 01:33:38.000000000 -0700
+@@ -25,8 +25,10 @@
#include <unistd.h>
#include <stdio.h>
+#include <stdlib.h>
#include <errno.h>
#include <fcntl.h>
++#include <string.h>
#include <sys/types.h>
-@@ -49,7 +50,8 @@
+ #include <sys/time.h>
+ #if defined(SysV)
+@@ -34,6 +36,7 @@
+ #include <sys/times.h>
+ #else
+ #include <sys/resource.h>
++#include <sys/wait.h>
+ #endif
+
+ #define IntSize (sizeof(int))
+@@ -49,7 +52,8 @@
#define Seeks (4000)
#define UpdateSeek (10)
#define SeekProcCount (3)
@@ -20,7 +31,12 @@ $NetBSD: patch-ac,v 1.3 2006/04/12 10:55:49 drochner Exp $
/* labels for the tests, used as an array index */
typedef enum
-@@ -91,7 +93,7 @@
+@@ -87,11 +91,12 @@
+ static double last_cpustamp = 0.0; /* for computing delta-t */
+ static double last_timestamp = 0.0; /* for computing delta-t */
+
++int
+ main(
int argc,
char * argv[])
{
@@ -29,7 +45,7 @@ $NetBSD: patch-ac,v 1.3 2006/04/12 10:55:49 drochner Exp $
int bufindex;
int chars[256];
int child;
-@@ -122,6 +124,8 @@
+@@ -122,6 +127,8 @@
for (next = 1; next < argc; next++)
if (strcmp(argv[next], "-d") == 0)
dir = argv[++next];
@@ -38,7 +54,7 @@ $NetBSD: patch-ac,v 1.3 2006/04/12 10:55:49 drochner Exp $
else if (strcmp(argv[next], "-s") == 0)
size = atol(argv[++next]);
else if (strcmp(argv[next], "-m") == 0)
-@@ -146,7 +150,12 @@
+@@ -146,7 +153,12 @@
/* size is in meg, rounded down to multiple of Chunk */
size *= (1024 * 1024);
size = Chunk * (size / Chunk);
@@ -52,7 +68,7 @@ $NetBSD: patch-ac,v 1.3 2006/04/12 10:55:49 drochner Exp $
/* Fill up a file, writing it a char at a time with the stdio putc() call */
fprintf(stderr, "Writing with putc()...");
-@@ -288,6 +297,7 @@
+@@ -288,6 +300,7 @@
{ /* child process */
/* set up and wait for the go-ahead */
@@ -60,7 +76,7 @@ $NetBSD: patch-ac,v 1.3 2006/04/12 10:55:49 drochner Exp $
close(seek_feedback[0]);
close(seek_control[1]);
newfile(name, &fd, &stream, 0);
-@@ -303,7 +313,13 @@
+@@ -303,7 +316,13 @@
/* loop until we read a 0 ticket back from our parent */
while(seek_tickets[0])
{ /* until Mom says stop */
@@ -75,7 +91,7 @@ $NetBSD: patch-ac,v 1.3 2006/04/12 10:55:49 drochner Exp $
((lseek_count++ % UpdateSeek) == 0));
if (read(seek_control[0], seek_tickets, 1) != 1)
io_error("read ticket");
-@@ -413,7 +429,7 @@
+@@ -413,7 +432,7 @@
printf("K/sec %%CPU K/sec %%CPU K/sec %%CPU K/sec %%CPU K/sec ");
printf("%%CPU /sec %%CPU\n");
@@ -84,7 +100,7 @@ $NetBSD: patch-ac,v 1.3 2006/04/12 10:55:49 drochner Exp $
printf("%5d %4.1f %5d %4.1f %5d %4.1f ",
(int) (((double) size) / (delta[(int) Putc][Elapsed] * 1024.0)),
delta[(int) Putc][CPU] / delta[(int) Putc][Elapsed] * 100.0,
-@@ -458,7 +474,7 @@
+@@ -458,7 +477,7 @@
usage()
{
fprintf(stderr,
@@ -93,7 +109,7 @@ $NetBSD: patch-ac,v 1.3 2006/04/12 10:55:49 drochner Exp $
exit(1);
}
-@@ -529,7 +545,7 @@
+@@ -529,7 +548,7 @@
{
char buf[Chunk];
@@ -102,7 +118,7 @@ $NetBSD: patch-ac,v 1.3 2006/04/12 10:55:49 drochner Exp $
perror(buf);
exit(1);
}
-@@ -568,7 +584,7 @@
+@@ -568,7 +587,7 @@
/* touch a word */
buf[((int) random() % (size/IntSize - 2)) + 1]--;