Skip to content

Commit

Permalink
Add Build-Only CI for OpenBSD, Dragonfly, and Haiku
Browse files Browse the repository at this point in the history
Signed-off-by: Joe Richey <joerichey@google.com>
  • Loading branch information
josephlr committed Oct 22, 2022
1 parent 2fa8cfc commit ddcec6d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .github/workflows/tests.yml
Expand Up @@ -319,6 +319,12 @@ jobs:
run: cargo build -Z build-std=core --target=aarch64-kmc-solid_asp3
- name: Nintendo 3DS
run: cargo build -Z build-std=core --target=armv6k-nintendo-3ds
- name: OpenBSD
run: cargo build -Z build-std=std --target=x86_64-unknown-openbsd --features=std
- name: Dragonfly BSD
run: cargo build -Z build-std=std --target=x86_64-unknown-dragonfly --features=std
- name: Haiku OS
run: cargo build -Z build-std=std --target=x86_64-unknown-haiku --features=std

clippy-fmt:
name: Clippy + rustfmt
Expand Down
4 changes: 3 additions & 1 deletion src/dragonfly.rs
Expand Up @@ -21,7 +21,9 @@ pub fn getrandom_inner(dest: &mut [MaybeUninit<u8>]) -> Result<(), Error> {
// getrandom(2) was introduced in DragonflyBSD 5.7
if let Some(fptr) = GETRANDOM.ptr() {
let func: GetRandomFn = unsafe { core::mem::transmute(fptr) };
return sys_fill_exact(dest, |buf| unsafe { func(buf.as_mut_ptr(), buf.len(), 0) });
return sys_fill_exact(dest, |buf| unsafe {
func(buf.as_mut_ptr() as *mut u8, buf.len(), 0)
});
} else {
use_file::getrandom_inner(dest)
}
Expand Down
1 change: 1 addition & 0 deletions src/openbsd.rs
Expand Up @@ -8,6 +8,7 @@

//! Implementation for OpenBSD
use crate::{util_libc::last_os_error, Error};
use core::mem::MaybeUninit;

pub fn getrandom_inner(dest: &mut [MaybeUninit<u8>]) -> Result<(), Error> {
// getentropy(2) was added in OpenBSD 5.6, so we can use it unconditionally.
Expand Down

0 comments on commit ddcec6d

Please sign in to comment.