Skip to content

Commit 32d7b1d

Browse files
committed
to: mac support
1 parent 4af6818 commit 32d7b1d

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

vm/src/libcwrap/mod.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ impl LibC {
9898
}
9999
}
100100

101-
#[cfg(not(target_os = "windows"))]
101+
#[cfg(target_os = "linux")]
102102
fn getrandom_inner(
103103
buf: *mut libc::c_void,
104104
buflen: libc::size_t,
@@ -107,6 +107,15 @@ fn getrandom_inner(
107107
unsafe { libc::syscall(libc::SYS_getrandom, buf, buflen, flags) as libc::ssize_t }
108108
}
109109

110+
#[cfg(target_os = "macos")]
111+
fn getrandom_inner(
112+
buf: *mut libc::c_void,
113+
buflen: libc::size_t,
114+
_flags: libc::c_uint,
115+
) -> libc::ssize_t {
116+
unsafe { libc::getentropy(buf, buflen) as libc::ssize_t }
117+
}
118+
110119
#[cfg(target_os = "windows")]
111120
fn getrandom_inner(
112121
buf: *mut libc::c_void,

0 commit comments

Comments
 (0)