aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-10-31 10:46:22 +0100
committerThomas Voss <mail@thomasvoss.com> 2024-10-31 10:48:06 +0100
commit92b848f05c63ce52cab1416e8b063cccbe341bb1 (patch)
tree983293fb2bce8131823770248cc2adc2d290cafb /src
parent94d0633ac6e323828f2f6dc89ee71d307e4c71f4 (diff)
Don’t use posix_fadvise() on MacOS or OpenBSD
These systems (despite being POSIX) have not yet implemented this function/syscall.
Diffstat (limited to 'src')
-rw-r--r--src/work.c2
1 files changed, 2 insertions, 0 deletions
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) {