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 #include #include +#define _XOPEN_SOURCE 600 +#include 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;