aboutsummaryrefslogtreecommitdiffstats
path: root/src/inputStream_file.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/inputStream_file.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/inputStream_file.c b/src/inputStream_file.c
index f4acd3a91..de1055eb2 100644
--- a/src/inputStream_file.c
+++ b/src/inputStream_file.c
@@ -25,6 +25,8 @@
#include <sys/types.h>
#include <unistd.h>
#include <errno.h>
+#define _XOPEN_SOURCE 600
+#include <fcntl.h>
void inputStream_initFile(void)
{
@@ -46,6 +48,10 @@ int inputStream_fileOpen(InputStream * inStream, char *filename)
inStream->size = ftell(fp);
fseek(fp, 0, SEEK_SET);
+#ifdef POSIX_FADV_SEQUENTIAL
+ posix_fadvise(fileno(fp), (off_t)0, inStream->size, POSIX_FADV_SEQUENTIAL);
+#endif
+
inStream->data = fp;
inStream->seekFunc = inputStream_fileSeek;
inStream->closeFunc = inputStream_fileClose;