From 5856dc87335a1834f70ceeb2081bc8d14765e89b Mon Sep 17 00:00:00 2001 From: Charly Delaroche Date: Wed, 1 Oct 2025 09:59:22 -0700 Subject: [PATCH] core/storage: Apple platforms support --- core/io/unix.rs | 8 ++++---- core/storage/buffer_pool.rs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/core/io/unix.rs b/core/io/unix.rs index b0d47f30f..8f9682491 100644 --- a/core/io/unix.rs +++ b/core/io/unix.rs @@ -309,12 +309,12 @@ impl File for UnixFile { let file = self.file.lock(); let result = unsafe { - #[cfg(not(any(target_os = "macos", target_os = "ios")))] + #[cfg(not(target_vendor = "apple"))] { libc::fsync(file.as_raw_fd()) } - #[cfg(any(target_os = "macos", target_os = "ios"))] + #[cfg(target_vendor = "apple")] { libc::fcntl(file.as_raw_fd(), libc::F_FULLFSYNC) } @@ -324,10 +324,10 @@ impl File for UnixFile { let e = std::io::Error::last_os_error(); Err(e.into()) } else { - #[cfg(not(any(target_os = "macos", target_os = "ios")))] + #[cfg(not(target_vendor = "apple"))] trace!("fsync"); - #[cfg(any(target_os = "macos", target_os = "ios"))] + #[cfg(target_vendor = "apple")] trace!("fcntl(F_FULLSYNC)"); c.complete(0); diff --git a/core/storage/buffer_pool.rs b/core/storage/buffer_pool.rs index abe4725e9..05fe77d6a 100644 --- a/core/storage/buffer_pool.rs +++ b/core/storage/buffer_pool.rs @@ -429,7 +429,7 @@ impl Arena { #[cfg(unix)] mod arena { - #[cfg(target_os = "macos")] + #[cfg(target_vendor = "apple")] use libc::MAP_ANON as MAP_ANONYMOUS; #[cfg(target_os = "linux")] use libc::MAP_ANONYMOUS;