Skip to content

Commit f91c5f4

Browse files
committed
Calling mincore on macos failed to fix
1 parent 4e964f2 commit f91c5f4

File tree

1 file changed

+5
-2
lines changed
  • rocketmq-store/src/utils

1 file changed

+5
-2
lines changed

rocketmq-store/src/utils/ffi.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,11 @@ pub fn mincore(addr: *const u8, len: usize, vec: *const u8) -> i32 {
100100

101101
#[cfg(target_os = "macos")]
102102
{
103-
// macos does not have mincore, so we just return 0
104-
0
103+
use std::ffi::c_void;
104+
105+
use libc::c_char;
106+
107+
unsafe { libc::mincore(addr as *mut c_void, len, vec as *mut c_char) }
105108
}
106109
#[cfg(target_os = "windows")]
107110
{

0 commit comments

Comments
 (0)