Skip to content

Commit

Permalink
Unrolled build for rust-lang#118748
Browse files Browse the repository at this point in the history
Rollup merge of rust-lang#118748 - devnexen:fbsd_getrandom_simpl, r=Nilstrieb,dtolnay

std: getrandom simplification for freebsd.

it is in the libcs' crate too now.
  • Loading branch information
rust-timer authored Jan 9, 2024
2 parents be00c5a + bc6a5c7 commit dde4791
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions library/std/src/sys/unix/rand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,7 @@ mod imp {

#[cfg(any(target_os = "espidf", target_os = "horizon", target_os = "freebsd"))]
fn getrandom(buf: &mut [u8]) -> libc::ssize_t {
#[cfg(not(target_os = "freebsd"))]
use libc::getrandom;
#[cfg(target_os = "freebsd")]
extern "C" {
fn getrandom(
buf: *mut libc::c_void,
buflen: libc::size_t,
flags: libc::c_uint,
) -> libc::ssize_t;
}
unsafe { getrandom(buf.as_mut_ptr().cast(), buf.len(), 0) }
unsafe { libc::getrandom(buf.as_mut_ptr().cast(), buf.len(), 0) }
}

#[cfg(not(any(
Expand Down

0 comments on commit dde4791

Please sign in to comment.