Commit 8ae16647 authored by Philip Carns's avatar Philip Carns

work around O_DIRECT and mkostemp

parent b4ed21f5
......@@ -13,10 +13,15 @@
#include <openssl/rand.h>
#include <errno.h>
#include "abt-io-config.h"
#include <abt.h>
#include <abt-io.h>
#include <abt-snoozer.h>
#ifndef HAVE_ODIRECT
#define O_DIRECT 0
#endif
struct worker_ult_common
{
int opt_io;
......@@ -244,7 +249,11 @@ static void worker_ult(void *_arg)
}
else
{
#ifdef HAVE_MKOSTEMP
fd = mkostemp(template, O_DIRECT|O_SYNC);
#else
fd = mkstemp(template);
#endif
if(fd < 0)
{
perror("mkostemp");
......
......@@ -13,10 +13,15 @@
#include <float.h>
#include <errno.h>
#include "abt-io-config.h"
#include <abt.h>
#include <abt-io.h>
#include <abt-snoozer.h>
#ifndef HAVE_ODIRECT
#define O_DIRECT 0
#endif
/* This is a simple benchmark that measures the
* streaming, concurrent, sequentially-issued write throughput for a
* specified number of concurrent operations. It includes an abt-io version and
......
......@@ -14,6 +14,12 @@
#include <errno.h>
#include <pthread.h>
#include "abt-io-config.h"
#ifndef HAVE_ODIRECT
#define O_DIRECT 0
#endif
struct worker_pthread_common
{
int opt_io;
......@@ -140,7 +146,11 @@ static void *worker_pthread(void *_arg)
if(common->opt_io)
{
#ifdef HAVE_MKOSTEMP
fd = mkostemp(template, O_DIRECT|O_SYNC);
#else
fd = mkstemp(template);
#endif
if(fd < 0)
{
perror("mkostemp");
......
......@@ -297,7 +297,11 @@ static void abt_io_mkostemp_fn(void *foo)
{
struct abt_io_mkostemp_state *state = foo;
#ifdef HAVE_MKOSTEMP
*state->ret = mkostemp(state->template, state->flags);
#else
*state->ret = mkstemp(state->template);
#endif
if(*state->ret < 0)
*state->ret = -errno;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment