Message ID | B80D2309-1C4D-4410-B182-C704EA9D9386@gmail.com |
---|---|
State | New |
Headers | show |
Series | block/file-posix.c: Fix compilation on macOS SDKs <10.12.4 | expand |
--- block/file-posix.c.orig +++ block/file-posix.c @@ -1830,7 +1830,9 @@ ret = do_fallocate(s->fd, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, aiocb->aio_offset, aiocb->aio_nbytes); ret = translate_err(-errno); -#elif defined(__APPLE__) && (__MACH__) +#elif defined(__APPLE__) && (__MACH__) && \ + defined(__MAC_OS_X_VERSION_MAX_ALLOWED) && \ + __MAC_OS_X_VERSION_MAX_ALLOWED >= 101204 fpunchhole_t fpunchhole; fpunchhole.fp_flags = 0; fpunchhole.reserved = 0;
fpunchhole_t was introduced in the macOS 10.12.4 SDK. For reference, see: https://developer.apple.com/documentation/kernel/fpunchhole_t Test the SDK version before attempting any fpunchhole_t-related logic. Signed-off-by: Evan Miller <emmiller@gmail.com>