From 0a02b9580145a6221820a1f9881bc1c0e85b2d99 Mon Sep 17 00:00:00 2001 From: leleliu008 Date: Fri, 30 Aug 2024 12:14:04 +0800 Subject: [PATCH] pread64(3) is linux-specific and not declared on other platforms https://www.man7.org/linux/man-pages/man2/pread.2.html https://man.freebsd.org/cgi/man.cgi?pread https://man.openbsd.org/OpenBSD-7.5/read.2 https://man.netbsd.org/read.2 Signed-off-by: leleliu008 --- src/fs_unix.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/fs_unix.cpp b/src/fs_unix.cpp index 315838f7..b9c17bf3 100644 --- a/src/fs_unix.cpp +++ b/src/fs_unix.cpp @@ -36,10 +36,10 @@ namespace unix { zsize_t FD::readAt(char* dest, zsize_t size, offset_t offset) const { -#if defined(__APPLE__) || defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__HAIKU__) -# define PREAD pread -#else +#if defined(__linux__) # define PREAD pread64 +#else +# define PREAD pread #endif ssize_t full_size_read = 0; auto size_to_read = size.v;