core/storage: Apple platforms support

This commit is contained in:
Charly Delaroche
2025-10-01 09:59:22 -07:00
parent bbd2c812c2
commit 5856dc8733
2 changed files with 5 additions and 5 deletions

View File

@@ -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);

View File

@@ -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;