diff options
author | hashimoto <hashimoto@chromium.org> | 2015-03-27 16:39:18 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-03-27 23:39:53 +0000 |
commit | 195310ab0b38de5704b9fa7ec9a804d68d3cdb88 (patch) | |
tree | 5ccd83dd8bb9d320cd777e5570cdc9e905c973be | |
parent | cbff2a79e3aafa333159dbc467efcb8a5dc124f7 (diff) | |
download | chromium_src-195310ab0b38de5704b9fa7ec9a804d68d3cdb88.zip chromium_src-195310ab0b38de5704b9fa7ec9a804d68d3cdb88.tar.gz chromium_src-195310ab0b38de5704b9fa7ec9a804d68d3cdb88.tar.bz2 |
Let sqlite use fdatasync() on Linux-based systems
fdatasync() should be faster than fsync().
From sqlite3.c:
/*
** We do not trust systems to provide a working fdatasync(). Some do.
** Others do no. To be safe, we will stick with the (slightly slower)
** fsync(). If you know that your system does support fdatasync() correctly,
** then simply compile with -Dfdatasync=fdatasync
*/
BUG=469071
Review URL: https://codereview.chromium.org/1035903002
Cr-Commit-Position: refs/heads/master@{#322679}
-rw-r--r-- | third_party/sqlite/BUILD.gn | 6 | ||||
-rw-r--r-- | third_party/sqlite/sqlite.gyp | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/third_party/sqlite/BUILD.gn b/third_party/sqlite/BUILD.gn index 80e1b37..526d16b 100644 --- a/third_party/sqlite/BUILD.gn +++ b/third_party/sqlite/BUILD.gn @@ -42,6 +42,12 @@ source_set("sqlite") { "HAVE_USLEEP=1", ] } + if (is_linux || is_android) { + defines += [ + # Linux provides fdatasync(), a faster equivalent of fsync(). + "fdatasync=fdatasync", + ] + } include_dirs = [ "amalgamation" ] diff --git a/third_party/sqlite/sqlite.gyp b/third_party/sqlite/sqlite.gyp index ed64e98..206ff26 100644 --- a/third_party/sqlite/sqlite.gyp +++ b/third_party/sqlite/sqlite.gyp @@ -62,6 +62,12 @@ 'HAVE_USLEEP=1', ], }], + ['OS == "linux" or OS == "android"', { + 'defines': [ + # Linux provides fdatasync(), a faster equivalent of fsync(). + 'fdatasync=fdatasync', + ], + }], ['use_system_sqlite', { 'type': 'none', 'direct_dependent_settings': { |