We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4af6818 commit 32d7b1dCopy full SHA for 32d7b1d
vm/src/libcwrap/mod.rs
@@ -98,7 +98,7 @@ impl LibC {
98
}
99
100
101
-#[cfg(not(target_os = "windows"))]
+#[cfg(target_os = "linux")]
102
fn getrandom_inner(
103
buf: *mut libc::c_void,
104
buflen: libc::size_t,
@@ -107,6 +107,15 @@ fn getrandom_inner(
107
unsafe { libc::syscall(libc::SYS_getrandom, buf, buflen, flags) as libc::ssize_t }
108
109
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
+
119
#[cfg(target_os = "windows")]
120
121
0 commit comments