// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+#include "acconfig.h"
+
#include <unistd.h>
#include "dumb_backend.h"
on_applied->complete(0);
if (do_fsync)
::fsync(fd);
+#ifdef HAVE_SYNC_FILE_RANGE
if (do_sync_file_range)
::sync_file_range(fd, offset, bl.length(),
SYNC_FILE_RANGE_WAIT_AFTER);
+#else
+# warning "sync_file_range not supported!"
+#endif
+#ifdef HAVE_POSIX_FADVISE
if (do_fadvise) {
int fa_r = ::posix_fadvise(fd, offset, bl.length(), POSIX_FADV_DONTNEED);
if (fa_r) {
std::cout << "posix_fadvise failed, errno is: " << fa_r << std::endl;
}
}
+#else
+# warning "posix_fadvise not supported!"
+#endif
::close(fd);
{
Mutex::Locker l(pending_commit_mutex);
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+#include "acconfig.h"
+
#include <boost/scoped_ptr.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/program_options/option.hpp>
);
}
+#ifndef HAVE_SYNC_FILE_RANGE
+ if (vm["sync-file-range"].as<bool>())
+ std::cerr << "Warning: sync_file_range(2) not supported!" << std::endl;
+#endif
+
+#ifndef HAVE_POSIX_FADVISE
+ if (vm["fadvise"].as<bool>())
+ std::cerr << "Warning: posix_fadvise(2) not supported!" << std::endl;
+#endif
+
Bencher bencher(
gen,
new DetailedStatCollector(1, new JSONFormatter, detailed_ops, &cout),