Call posix_fadvise() each time we open a new file, not just on the first one.

This commit is contained in:
Andrew Wood
2024-10-05 15:00:08 +01:00
parent de2fe7f6be
commit ea3787e393
2 changed files with 5 additions and 0 deletions
+4
View File
@@ -258,6 +258,10 @@ int pv_main_loop(pvstate_t state)
if (input_fd >= 0) {
eof_in = false;
eof_out = false;
#if HAVE_POSIX_FADVISE
/* Advise the OS that we will only be reading sequentially. */
(void) posix_fadvise(input_fd, 0, 0, POSIX_FADV_SEQUENTIAL);
#endif
}
}