From 92b848f05c63ce52cab1416e8b063cccbe341bb1 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Thu, 31 Oct 2024 10:46:22 +0100 Subject: Don’t use posix_fadvise() on MacOS or OpenBSD MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These systems (despite being POSIX) have not yet implemented this function/syscall. --- src/work.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/work.c b/src/work.c index 510fa07..7656d4d 100644 --- a/src/work.c +++ b/src/work.c @@ -82,7 +82,9 @@ process_file(const char *locl_filename, unsigned char **locl_buf) goto err; } +#if !defined(__APPLE__) && !defined(__OpenBSD__) (void)posix_fadvise(fd, 0, 0, POSIX_FADV_SEQUENTIAL | POSIX_FADV_WILLNEED); +#endif struct stat st; if (fstat(fd, &st) == -1) { -- cgit v1.2.3