aboutsummaryrefslogtreecommitdiffstats
path: root/src/util/io.h
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2017-04-09 23:46:17 +0200
committerMattias Andrée <maandree@kth.se>2017-04-09 23:46:17 +0200
commitdac6950d9e556d5521ad7913d27a6cf83e2a90a1 (patch)
treebb6a65d973337a0504117888d5534967cc51f479 /src/util/io.h
parentClean up (diff)
downloadblind-dac6950d9e556d5521ad7913d27a6cf83e2a90a1.tar.gz
blind-dac6950d9e556d5521ad7913d27a6cf83e2a90a1.tar.bz2
blind-dac6950d9e556d5521ad7913d27a6cf83e2a90a1.tar.xz
Clean up
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'src/util/io.h')
-rw-r--r--src/util/io.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/util/io.h b/src/util/io.h
index 44e222d..8c646cb 100644
--- a/src/util/io.h
+++ b/src/util/io.h
@@ -1,4 +1,17 @@
/* See LICENSE file for copyright and license details. */
+#include <fcntl.h>
+
+#if defined(POSIX_FADV_SEQUENTIAL)
+# define fadvise_sequential(...) posix_fadvise(__VA_ARGS__, POSIX_FADV_SEQUENTIAL)
+#else
+# define fadvise_sequential(...)
+#endif
+
+#if defined(POSIX_FADV_RANDOM)
+# define fadvise_random(...) posix_fadvise(__VA_ARGS__, POSIX_FADV_RANDOM)
+#else
+# define fadvise_random(...)
+#endif
#define ewriteall(...) enwriteall(1, __VA_ARGS__)
#define ereadall(...) enreadall(1, __VA_ARGS__)