Skip to content

Commit 0bae019

Browse files
committed
feat: add macos sync io
1 parent 4299e69 commit 0bae019

File tree

8 files changed

+355
-257
lines changed

8 files changed

+355
-257
lines changed

src/lib.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,10 @@ pub type Result<T> = ::std::result::Result<T, Error>;
117117
pub mod abi;
118118
pub mod api;
119119

120-
// #[cfg(all(any(feature = "fusedev", feature = "virtiofs"), target_os = "linux"))]
120+
#[cfg(all(
121+
any(feature = "fusedev", feature = "virtiofs"),
122+
any(target_os = "macos", target_os = "linux")
123+
))]
121124
pub mod passthrough;
122125
pub mod transport;
123126

src/passthrough/macos_sync_io.rs

-197
This file was deleted.

src/passthrough/mod.rs

+11-4
Original file line numberDiff line numberDiff line change
@@ -58,17 +58,14 @@ mod config;
5858
mod file_handle;
5959
mod inode_store;
6060
#[cfg(target_os = "linux")]
61-
mod linux_sync_io;
62-
#[cfg(target_os = "macos")]
63-
mod macos_sync_io;
64-
#[cfg(target_os = "linux")]
6561
mod mount_fd;
6662
#[cfg(target_os = "linux")]
6763
mod os_compat;
6864
#[cfg(target_os = "macos")]
6965
mod stat;
7066
#[cfg(target_os = "linux")]
7167
mod statx;
68+
mod sync_io;
7269
mod util;
7370

7471
type Inode = u64;
@@ -89,6 +86,16 @@ type LibCStat = libc::stat64;
8986
#[cfg(target_os = "macos")]
9087
type LibCStat = libc::stat;
9188

89+
#[cfg(target_os = "linux")]
90+
type OffT = libc::off64_t;
91+
#[cfg(target_os = "macos")]
92+
type OffT = libc::off_t;
93+
94+
#[cfg(target_os = "linux")]
95+
type StatVfs = libc::statvfs64;
96+
#[cfg(target_os = "macos")]
97+
type StatVfs = libc::statvfs;
98+
9299
/// Maximum host inode number supported by passthroughfs
93100
const MAX_HOST_INO: u64 = 0x7fff_ffff_ffff;
94101

0 commit comments

Comments
 (0)