rust/tests/compile-fail/getrandom.rs

14 lines
397 B
Rust
Raw Normal View History

2019-04-16 19:06:08 +02:00
// ignore-macos: Uses Linux-only APIs
// ignore-windows: Uses Linux-only APIs
2019-04-08 23:16:13 -04:00
#![feature(rustc_private)]
extern crate libc;
fn main() {
let mut buf = [0u8; 5];
unsafe {
2019-04-08 22:22:41 -04:00
libc::syscall(libc::SYS_getrandom, buf.as_mut_ptr() as *mut libc::c_void, 5 as libc::size_t, 0 as libc::c_uint);
2019-04-21 13:18:05 +02:00
//~^ ERROR miri does not support gathering system entropy in deterministic mode!
}
}