Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
#############################################################################*/
#include <errno.h>
+#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
if (!archive->f)
return 1;
+ // Let the kernel know, that we will read the file sequentially
+ r = posix_fadvise(fileno(archive->f), 0, 0, POSIX_FADV_SEQUENTIAL);
+ if (r) {
+ ERROR(archive->pakfire, "posix_fadvise() failed: %m\n");
+ goto ERROR;
+ }
+
// Call stat() on f
r = fstat(fileno(archive->f), &archive->stat);
if (r) {