aboutsummaryrefslogtreecommitdiffstats
path: root/vespalib/src/apps
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@broadpark.no>2020-04-20 13:24:54 +0200
committerTor Egge <Tor.Egge@broadpark.no>2020-04-20 13:24:54 +0200
commita1082a01aaff0cbb5fd3d9cd48fb12a2b2397ac9 (patch)
tree67ec1a7da0432da11282ae2b789261c940f10bd3 /vespalib/src/apps
parenteb5129002b5a3053882273707666b7c7786b4e6d (diff)
posix_fadvise() is not generally available.
Diffstat (limited to 'vespalib/src/apps')
-rw-r--r--vespalib/src/apps/vespa-drop-file-from-cache/drop_file_from_cache.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/vespalib/src/apps/vespa-drop-file-from-cache/drop_file_from_cache.cpp b/vespalib/src/apps/vespa-drop-file-from-cache/drop_file_from_cache.cpp
index 7e15885270c..280edf729b6 100644
--- a/vespalib/src/apps/vespa-drop-file-from-cache/drop_file_from_cache.cpp
+++ b/vespalib/src/apps/vespa-drop-file-from-cache/drop_file_from_cache.cpp
@@ -21,12 +21,14 @@ int main(int argc, char **argv) {
}
int retval = 0;
+#ifdef __linux__
int err = posix_fadvise(fh, 0, 0, POSIX_FADV_DONTNEED);
if (err != 0) {
std::error_code ec(errno, std::system_category());
fprintf(stderr, "posix_fadvise failed: %s\n", ec.message().c_str());
retval = 3;
}
+#endif
close(fh);
return retval;
}