View | Details | Raw Unified | Return to bug 210854 | Differences between
and this patch

Collapse All | Expand All

(-)Makefile (-1 / +1 lines)
Lines 3-9 Link Here
3
3
4
PORTNAME=	bonnie
4
PORTNAME=	bonnie
5
PORTVERSION=	2.0.6
5
PORTVERSION=	2.0.6
6
PORTREVISION=	1
6
2ORTREVISION=	2
7
CATEGORIES=	benchmarks
7
CATEGORIES=	benchmarks
8
MASTER_SITES=	http://www.textuality.com/bonnie/
8
MASTER_SITES=	http://www.textuality.com/bonnie/
9
DISTNAME=	bonnie
9
DISTNAME=	bonnie
(-)files/patch-Bonnie.c (-23 / +25 lines)
Lines 1-9 Link Here
1
--- Bonnie.c.orig	1996-08-28 16:23:49 UTC
1
--- Bonnie.c.orig	2019-09-02 12:03:25 UTC
2
+++ Bonnie.c
2
+++ Bonnie.c
3
@@ -25,6 +25,9 @@
3
@@ -25,6 +25,11 @@
4
 
4
 
5
 #include <unistd.h>
5
 #include <unistd.h>
6
 #include <stdio.h>
6
 #include <stdio.h>
7
+#include <string.h>
8
+#include <sys/wait.h>
7
+#if !defined(SysV)
9
+#if !defined(SysV)
8
+#include <stdlib.h>
10
+#include <stdlib.h>
9
+#endif
11
+#endif
Lines 10-16 Link Here
10
 #include <errno.h>
12
 #include <errno.h>
11
 #include <fcntl.h>
13
 #include <fcntl.h>
12
 #include <sys/types.h>
14
 #include <sys/types.h>
13
@@ -49,7 +52,7 @@
15
@@ -49,7 +54,7 @@
14
 #define Seeks (4000)
16
 #define Seeks (4000)
15
 #define UpdateSeek (10)
17
 #define UpdateSeek (10)
16
 #define SeekProcCount (3)
18
 #define SeekProcCount (3)
Lines 19-25 Link Here
19
 
21
 
20
 /* labels for the tests, used as an array index */
22
 /* labels for the tests, used as an array index */
21
 typedef enum
23
 typedef enum
22
@@ -87,7 +90,7 @@ static double delta[(int) TestCount][2];
24
@@ -87,7 +92,7 @@ static double delta[(int) TestCount][2];
23
 static double last_cpustamp = 0.0;       /* for computing delta-t */
25
 static double last_cpustamp = 0.0;       /* for computing delta-t */
24
 static double last_timestamp = 0.0;      /* for computing delta-t */
26
 static double last_timestamp = 0.0;      /* for computing delta-t */
25
 
27
 
Lines 28-44 Link Here
28
   int    argc,
30
   int    argc,
29
   char * argv[])
31
   char * argv[])
30
 {
32
 {
31
@@ -146,7 +149,7 @@ main(
33
@@ -167,7 +172,7 @@ main(
32
   /* size is in meg, rounded down to multiple of Chunk */
33
   size *= (1024 * 1024);
34
   size = Chunk * (size / Chunk);
35
-  fprintf(stderr, "File '%s', size: %ld\n", name, size);
36
+  fprintf(stderr, "File '%s', size: %lld\n", name, size);
37
 
34
 
38
   /* Fill up a file, writing it a char at a time with the stdio putc() call */
39
   fprintf(stderr, "Writing with putc()...");
40
@@ -167,7 +170,7 @@ main(
41
 
42
   /* Now read & rewrite it using block I/O.  Dirty one word in each block */
35
   /* Now read & rewrite it using block I/O.  Dirty one word in each block */
43
   newfile(name, &fd, &stream, 0);
36
   newfile(name, &fd, &stream, 0);
44
-  if (lseek(fd, (off_t) 0, 0) == (off_t) -1)
37
-  if (lseek(fd, (off_t) 0, 0) == (off_t) -1)
Lines 46-52 Link Here
46
     io_error("lseek(2) before rewrite");
39
     io_error("lseek(2) before rewrite");
47
   fprintf(stderr, "Rewriting...");
40
   fprintf(stderr, "Rewriting...");
48
   timestamp();
41
   timestamp();
49
@@ -179,7 +182,7 @@ main(
42
@@ -179,7 +184,7 @@ main(
50
     if (bufindex == Chunk / IntSize)
43
     if (bufindex == Chunk / IntSize)
51
       bufindex = 0;
44
       bufindex = 0;
52
     buf[bufindex++]++;
45
     buf[bufindex++]++;
Lines 55-61 Link Here
55
       io_error("relative lseek(2)");
48
       io_error("relative lseek(2)");
56
     if (write(fd, (char *) buf, words) == -1)
49
     if (write(fd, (char *) buf, words) == -1)
57
       io_error("re write(2)");
50
       io_error("re write(2)");
58
@@ -235,7 +238,7 @@ main(
51
@@ -235,7 +240,7 @@ main(
59
 
52
 
60
   /* Now suck it in, Chunk at a time, as fast as we can */
53
   /* Now suck it in, Chunk at a time, as fast as we can */
61
   newfile(name, &fd, &stream, 0);
54
   newfile(name, &fd, &stream, 0);
Lines 64-70 Link Here
64
     io_error("lseek before read");
57
     io_error("lseek before read");
65
   fprintf(stderr, "Reading intelligently...");
58
   fprintf(stderr, "Reading intelligently...");
66
   timestamp();
59
   timestamp();
67
@@ -288,6 +291,7 @@ main(
60
@@ -288,6 +293,7 @@ main(
68
     { /* child process */
61
     { /* child process */
69
 
62
 
70
       /* set up and wait for the go-ahead */
63
       /* set up and wait for the go-ahead */
Lines 72-78 Link Here
72
       close(seek_feedback[0]);
65
       close(seek_feedback[0]);
73
       close(seek_control[1]);
66
       close(seek_control[1]);
74
       newfile(name, &fd, &stream, 0);
67
       newfile(name, &fd, &stream, 0);
75
@@ -303,7 +307,12 @@ main(
68
@@ -303,7 +309,12 @@ main(
76
       /* loop until we read a 0 ticket back from our parent */
69
       /* loop until we read a 0 ticket back from our parent */
77
       while(seek_tickets[0])
70
       while(seek_tickets[0])
78
       { /* until Mom says stop */
71
       { /* until Mom says stop */
Lines 86-101 Link Here
86
 	  ((lseek_count++ % UpdateSeek) == 0));
79
 	  ((lseek_count++ % UpdateSeek) == 0));
87
 	if (read(seek_control[0], seek_tickets, 1) != 1)
80
 	if (read(seek_control[0], seek_tickets, 1) != 1)
88
 	  io_error("read ticket");
81
 	  io_error("read ticket");
89
@@ -413,7 +422,7 @@ report(
82
@@ -380,7 +391,7 @@ write_html(
83
   off_t  size)
84
 {
85
 
86
-  printf("<TR><TD>%s</TD><TD>%d</TD>", machine, size / (1024 * 1024));
87
+  printf("<TR><TD>%s</TD><TD>%ld</TD>", machine, size / (1024 * 1024));
88
   printf("<TD>%d</TD><TD>%4.1f</TD><TD>%d</TD><TD>%4.1f</TD><TD>%d</TD><TD>%4.1f</TD>",
89
     (int) (((double) size) / (delta[(int) Putc][Elapsed] * 1024.0)),
90
     delta[(int) Putc][CPU] / delta[(int) Putc][Elapsed] * 100.0,
91
@@ -413,7 +424,7 @@ report(
90
   printf("K/sec %%CPU K/sec %%CPU K/sec %%CPU K/sec %%CPU K/sec ");
92
   printf("K/sec %%CPU K/sec %%CPU K/sec %%CPU K/sec %%CPU K/sec ");
91
   printf("%%CPU  /sec %%CPU\n");
93
   printf("%%CPU  /sec %%CPU\n");
92
 
94
 
93
-  printf("%-8.8s %4d ", machine, size / (1024 * 1024));
95
-  printf("%-8.8s %4d ", machine, size / (1024 * 1024));
94
+  printf("%-8.8s %4lld ", machine, size / (1024 * 1024));
96
+  printf("%-8.8s %4ld ", machine, size / (1024 * 1024));
95
   printf("%5d %4.1f %5d %4.1f %5d %4.1f ",
97
   printf("%5d %4.1f %5d %4.1f %5d %4.1f ",
96
     (int) (((double) size) / (delta[(int) Putc][Elapsed] * 1024.0)),
98
     (int) (((double) size) / (delta[(int) Putc][Elapsed] * 1024.0)),
97
     delta[(int) Putc][CPU] / delta[(int) Putc][Elapsed] * 100.0,
99
     delta[(int) Putc][CPU] / delta[(int) Putc][Elapsed] * 100.0,
98
@@ -529,7 +538,10 @@ io_error(char * message)
100
@@ -529,7 +540,10 @@ io_error(char * message)
99
 {
101
 {
100
   char buf[Chunk];
102
   char buf[Chunk];
101
 
103
 
Lines 107-113 Link Here
107
   perror(buf);
109
   perror(buf);
108
   exit(1);
110
   exit(1);
109
 }
111
 }
110
@@ -557,7 +569,7 @@ doseek(
112
@@ -557,7 +571,7 @@ doseek(
111
   off_t size;
113
   off_t size;
112
 
114
 
113
   probe = where * Chunk;
115
   probe = where * Chunk;
Lines 116-122 Link Here
116
     io_error("lseek in doseek");
118
     io_error("lseek in doseek");
117
   if ((size = read(fd, (char *) buf, Chunk)) == -1)
119
   if ((size = read(fd, (char *) buf, Chunk)) == -1)
118
     io_error("read in doseek");
120
     io_error("read in doseek");
119
@@ -568,7 +580,7 @@ doseek(
121
@@ -568,7 +582,7 @@ doseek(
120
 
122
 
121
     /* touch a word */
123
     /* touch a word */
122
     buf[((int) random() % (size/IntSize - 2)) + 1]--;
124
     buf[((int) random() % (size/IntSize - 2)) + 1]--;

Return to bug 210854