make util/env_posix.cc work under mac

Summary: This diff invoves some more complicated issues in the posix environment.

Test Plan: works under mac os. will need to verify dev box.

Reviewers: dhruba

Reviewed By: dhruba

CC: leveldb

Differential Revision: https://reviews.facebook.net/D14061
This commit is contained in:
kailiu
2013-11-16 23:44:39 -08:00
parent 7604e2f70c
commit 97d8e573a6
11 changed files with 241 additions and 79 deletions

View File

@@ -45,23 +45,22 @@ struct EnvOptions {
explicit EnvOptions(const Options& options);
// If true, then allow caching of data in environment buffers
bool use_os_buffer;
bool use_os_buffer = true;
// If true, then use mmap to read data
bool use_mmap_reads;
bool use_mmap_reads = false;
// If true, then use mmap to write data
bool use_mmap_writes;
bool use_mmap_writes = true;
// If true, set the FD_CLOEXEC on open fd.
bool set_fd_cloexec;
bool set_fd_cloexec= true;
// Allows OS to incrementally sync files to disk while they are being
// written, in the background. Issue one request for every bytes_per_sync
// written. 0 turns it off.
// Default: 0
uint64_t bytes_per_sync;
uint64_t bytes_per_sync = 0;
};
class Env {