gettimeofday(&start_t, NULL);
for (i = 0; i < loops; i++)
{
- if ((tmpfile = open(filename, O_RDWR)) == -1)
+ if ((tmpfile = open(filename, O_RDWR, 0)) == -1)
die("Cannot open output file.");
if (write(tmpfile, buf, WRITE_SIZE/2) != WRITE_SIZE/2)
die("write failed");
gettimeofday(&start_t, NULL);
for (i = 0; i < loops; i++)
{
- if ((tmpfile = open(filename, O_RDWR)) == -1)
+ if ((tmpfile = open(filename, O_RDWR, 0)) == -1)
die("Cannot open output file.");
if (write(tmpfile, buf, WRITE_SIZE/2) != WRITE_SIZE/2)
die("write failed");
if (fsync(tmpfile) != 0)
die("fsync failed");
close(tmpfile);
- if ((tmpfile = open(filename, O_RDWR)) == -1)
+ if ((tmpfile = open(filename, O_RDWR, 0)) == -1)
die("Cannot open output file.");
/* do nothing but the open/close the tests are consistent. */
close(tmpfile);
gettimeofday(&start_t, NULL);
for (i = 0; i < loops; i++)
{
- if ((tmpfile = open(filename, O_RDWR)) == -1)
+ if ((tmpfile = open(filename, O_RDWR, 0)) == -1)
die("Cannot open output file.");
if (write(tmpfile, buf, WRITE_SIZE/2) != WRITE_SIZE/2)
die("write failed");
close(tmpfile);
/* reopen file */
- if ((tmpfile = open(filename, O_RDWR)) == -1)
+ if ((tmpfile = open(filename, O_RDWR, 0)) == -1)
die("Cannot open output file.");
if (fsync(tmpfile) != 0)
die("fsync failed");
#ifdef OPEN_SYNC_FLAG
/* 16k o_sync write */
- if ((tmpfile = open(filename, O_RDWR | OPEN_SYNC_FLAG)) == -1)
+ if ((tmpfile = open(filename, O_RDWR | OPEN_SYNC_FLAG, 0)) == -1)
die("Cannot open output file.");
gettimeofday(&start_t, NULL);
for (i = 0; i < loops; i++)
printf("\n");
/* 2*8k o_sync writes */
- if ((tmpfile = open(filename, O_RDWR | OPEN_SYNC_FLAG)) == -1)
+ if ((tmpfile = open(filename, O_RDWR | OPEN_SYNC_FLAG, 0)) == -1)
die("Cannot open output file.");
gettimeofday(&start_t, NULL);
for (i = 0; i < loops; i++)
#ifdef OPEN_DATASYNC_FLAG
/* open_dsync, write */
- if ((tmpfile = open(filename, O_RDWR | O_DSYNC)) == -1)
+ if ((tmpfile = open(filename, O_RDWR | O_DSYNC, 0)) == -1)
die("Cannot open output file.");
gettimeofday(&start_t, NULL);
for (i = 0; i < loops; i++)
printf("\n");
#ifdef OPEN_SYNC_FLAG
/* open_fsync, write */
- if ((tmpfile = open(filename, O_RDWR | OPEN_SYNC_FLAG)) == -1)
+ if ((tmpfile = open(filename, O_RDWR | OPEN_SYNC_FLAG, 0)) == -1)
die("Cannot open output file.");
gettimeofday(&start_t, NULL);
for (i = 0; i < loops; i++)
#ifdef HAVE_FDATASYNC
/* write, fdatasync */
- if ((tmpfile = open(filename, O_RDWR)) == -1)
+ if ((tmpfile = open(filename, O_RDWR, 0)) == -1)
die("Cannot open output file.");
gettimeofday(&start_t, NULL);
for (i = 0; i < loops; i++)
printf("\n");
/* write, fsync, close */
- if ((tmpfile = open(filename, O_RDWR)) == -1)
+ if ((tmpfile = open(filename, O_RDWR, 0)) == -1)
die("Cannot open output file.");
gettimeofday(&start_t, NULL);
for (i = 0; i < loops; i++)
#ifdef OPEN_DATASYNC_FLAG
/* open_dsync, write */
- if ((tmpfile = open(filename, O_RDWR | O_DSYNC)) == -1)
+ if ((tmpfile = open(filename, O_RDWR | O_DSYNC, 0)) == -1)
die("Cannot open output file.");
gettimeofday(&start_t, NULL);
for (i = 0; i < loops; i++)
#ifdef OPEN_SYNC_FLAG
/* open_fsync, write */
- if ((tmpfile = open(filename, O_RDWR | OPEN_SYNC_FLAG)) == -1)
+ if ((tmpfile = open(filename, O_RDWR | OPEN_SYNC_FLAG, 0)) == -1)
die("Cannot open output file.");
gettimeofday(&start_t, NULL);
for (i = 0; i < loops; i++)
#ifdef HAVE_FDATASYNC
/* write, fdatasync */
- if ((tmpfile = open(filename, O_RDWR)) == -1)
+ if ((tmpfile = open(filename, O_RDWR, 0)) == -1)
die("Cannot open output file.");
gettimeofday(&start_t, NULL);
for (i = 0; i < loops; i++)
printf("\n");
/* write, fsync, close */
- if ((tmpfile = open(filename, O_RDWR)) == -1)
+ if ((tmpfile = open(filename, O_RDWR, 0)) == -1)
die("Cannot open output file.");
gettimeofday(&start_t, NULL);
for (i = 0; i < loops; i++)