X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/05da63da0c391d4cca46cd32dbff7bc8a5266cb7..a1b1c1ea3adb864c8c2e3feb4eaed890a9b505cf:/src/config.h?ds=inline diff --git a/src/config.h b/src/config.h index 28ef37d6..617682fc 100644 --- a/src/config.h +++ b/src/config.h @@ -52,6 +52,14 @@ #define aof_fsync fsync #endif +/* Define rdb_fsync_range to sync_file_range() on Linux, otherwise we use + * the plain fsync() call. */ +#ifdef __linux__ +#define rdb_fsync_range(fd,off,size) sync_file_range(fd,off,size,SYNC_FILE_RANGE_WAIT_BEFORE|SYNC_FILE_RANGE_WRITE) +#else +#define rdb_fsync_range(fd,off,size) fsync(fd) +#endif + /* Byte ordering detection */ #include /* This will likely define BYTE_ORDER */