@@ -72,7 +72,7 @@ main(int argc, char *argv[])
72
72
gettimeofday (& start_t , NULL );
73
73
for (i = 0 ; i < loops ; i ++ )
74
74
{
75
- if ((tmpfile = open (filename , O_RDWR )) == -1 )
75
+ if ((tmpfile = open (filename , O_RDWR , 0 )) == -1 )
76
76
die ("Cannot open output file." );
77
77
if (write (tmpfile , buf , WRITE_SIZE /2 ) != WRITE_SIZE /2 )
78
78
die ("write failed" );
@@ -90,14 +90,14 @@ main(int argc, char *argv[])
90
90
gettimeofday (& start_t , NULL );
91
91
for (i = 0 ; i < loops ; i ++ )
92
92
{
93
- if ((tmpfile = open (filename , O_RDWR )) == -1 )
93
+ if ((tmpfile = open (filename , O_RDWR , 0 )) == -1 )
94
94
die ("Cannot open output file." );
95
95
if (write (tmpfile , buf , WRITE_SIZE /2 ) != WRITE_SIZE /2 )
96
96
die ("write failed" );
97
97
if (fsync (tmpfile ) != 0 )
98
98
die ("fsync failed" );
99
99
close (tmpfile );
100
- if ((tmpfile = open (filename , O_RDWR )) == -1 )
100
+ if ((tmpfile = open (filename , O_RDWR , 0 )) == -1 )
101
101
die ("Cannot open output file." );
102
102
/* do nothing but the open/close the tests are consistent. */
103
103
close (tmpfile );
@@ -111,13 +111,13 @@ main(int argc, char *argv[])
111
111
gettimeofday (& start_t , NULL );
112
112
for (i = 0 ; i < loops ; i ++ )
113
113
{
114
- if ((tmpfile = open (filename , O_RDWR )) == -1 )
114
+ if ((tmpfile = open (filename , O_RDWR , 0 )) == -1 )
115
115
die ("Cannot open output file." );
116
116
if (write (tmpfile , buf , WRITE_SIZE /2 ) != WRITE_SIZE /2 )
117
117
die ("write failed" );
118
118
close (tmpfile );
119
119
/* reopen file */
120
- if ((tmpfile = open (filename , O_RDWR )) == -1 )
120
+ if ((tmpfile = open (filename , O_RDWR , 0 )) == -1 )
121
121
die ("Cannot open output file." );
122
122
if (fsync (tmpfile ) != 0 )
123
123
die ("fsync failed" );
@@ -132,7 +132,7 @@ main(int argc, char *argv[])
132
132
133
133
#ifdef OPEN_SYNC_FLAG
134
134
/* 16k o_sync write */
135
- if ((tmpfile = open (filename , O_RDWR | OPEN_SYNC_FLAG )) == -1 )
135
+ if ((tmpfile = open (filename , O_RDWR | OPEN_SYNC_FLAG , 0 )) == -1 )
136
136
die ("Cannot open output file." );
137
137
gettimeofday (& start_t , NULL );
138
138
for (i = 0 ; i < loops ; i ++ )
@@ -145,7 +145,7 @@ main(int argc, char *argv[])
145
145
printf ("\n" );
146
146
147
147
/* 2*8k o_sync writes */
148
- if ((tmpfile = open (filename , O_RDWR | OPEN_SYNC_FLAG )) == -1 )
148
+ if ((tmpfile = open (filename , O_RDWR | OPEN_SYNC_FLAG , 0 )) == -1 )
149
149
die ("Cannot open output file." );
150
150
gettimeofday (& start_t , NULL );
151
151
for (i = 0 ; i < loops ; i ++ )
@@ -169,7 +169,7 @@ main(int argc, char *argv[])
169
169
170
170
#ifdef OPEN_DATASYNC_FLAG
171
171
/* open_dsync, write */
172
- if ((tmpfile = open (filename , O_RDWR | O_DSYNC )) == -1 )
172
+ if ((tmpfile = open (filename , O_RDWR | O_DSYNC , 0 )) == -1 )
173
173
die ("Cannot open output file." );
174
174
gettimeofday (& start_t , NULL );
175
175
for (i = 0 ; i < loops ; i ++ )
@@ -182,7 +182,7 @@ main(int argc, char *argv[])
182
182
printf ("\n" );
183
183
#ifdef OPEN_SYNC_FLAG
184
184
/* open_fsync, write */
185
- if ((tmpfile = open (filename , O_RDWR | OPEN_SYNC_FLAG )) == -1 )
185
+ if ((tmpfile = open (filename , O_RDWR | OPEN_SYNC_FLAG , 0 )) == -1 )
186
186
die ("Cannot open output file." );
187
187
gettimeofday (& start_t , NULL );
188
188
for (i = 0 ; i < loops ; i ++ )
@@ -200,7 +200,7 @@ main(int argc, char *argv[])
200
200
201
201
#ifdef HAVE_FDATASYNC
202
202
/* write, fdatasync */
203
- if ((tmpfile = open (filename , O_RDWR )) == -1 )
203
+ if ((tmpfile = open (filename , O_RDWR , 0 )) == -1 )
204
204
die ("Cannot open output file." );
205
205
gettimeofday (& start_t , NULL );
206
206
for (i = 0 ; i < loops ; i ++ )
@@ -219,7 +219,7 @@ main(int argc, char *argv[])
219
219
printf ("\n" );
220
220
221
221
/* write, fsync, close */
222
- if ((tmpfile = open (filename , O_RDWR )) == -1 )
222
+ if ((tmpfile = open (filename , O_RDWR , 0 )) == -1 )
223
223
die ("Cannot open output file." );
224
224
gettimeofday (& start_t , NULL );
225
225
for (i = 0 ; i < loops ; i ++ )
@@ -239,7 +239,7 @@ main(int argc, char *argv[])
239
239
240
240
#ifdef OPEN_DATASYNC_FLAG
241
241
/* open_dsync, write */
242
- if ((tmpfile = open (filename , O_RDWR | O_DSYNC )) == -1 )
242
+ if ((tmpfile = open (filename , O_RDWR | O_DSYNC , 0 )) == -1 )
243
243
die ("Cannot open output file." );
244
244
gettimeofday (& start_t , NULL );
245
245
for (i = 0 ; i < loops ; i ++ )
@@ -260,7 +260,7 @@ main(int argc, char *argv[])
260
260
261
261
#ifdef OPEN_SYNC_FLAG
262
262
/* open_fsync, write */
263
- if ((tmpfile = open (filename , O_RDWR | OPEN_SYNC_FLAG )) == -1 )
263
+ if ((tmpfile = open (filename , O_RDWR | OPEN_SYNC_FLAG , 0 )) == -1 )
264
264
die ("Cannot open output file." );
265
265
gettimeofday (& start_t , NULL );
266
266
for (i = 0 ; i < loops ; i ++ )
@@ -279,7 +279,7 @@ main(int argc, char *argv[])
279
279
280
280
#ifdef HAVE_FDATASYNC
281
281
/* write, fdatasync */
282
- if ((tmpfile = open (filename , O_RDWR )) == -1 )
282
+ if ((tmpfile = open (filename , O_RDWR , 0 )) == -1 )
283
283
die ("Cannot open output file." );
284
284
gettimeofday (& start_t , NULL );
285
285
for (i = 0 ; i < loops ; i ++ )
@@ -300,7 +300,7 @@ main(int argc, char *argv[])
300
300
printf ("\n" );
301
301
302
302
/* write, fsync, close */
303
- if ((tmpfile = open (filename , O_RDWR )) == -1 )
303
+ if ((tmpfile = open (filename , O_RDWR , 0 )) == -1 )
304
304
die ("Cannot open output file." );
305
305
gettimeofday (& start_t , NULL );
306
306
for (i = 0 ; i < loops ; i ++ )
0 commit comments