Skip to content

Commit 5673a61

Browse files
committed
Add Build-Only CI for OpenBSD, Dragonfly, and Haiku
Signed-off-by: Joe Richey <joerichey@google.com>
1 parent 2fa8cfc commit 5673a61

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

.github/workflows/tests.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,12 @@ jobs:
319319
run: cargo build -Z build-std=core --target=aarch64-kmc-solid_asp3
320320
- name: Nintendo 3DS
321321
run: cargo build -Z build-std=core --target=armv6k-nintendo-3ds
322+
- name: OpenBSD
323+
run: cargo build -Z build-std=std --target=x86_64-unknown-openbsd --features=std
324+
- name: Dragonfly BSD
325+
run: cargo build -Z build-std=std --target=x86_64-unknown-dragonfly --features=std
326+
- name: Haiku OS
327+
run: cargo build -Z build-std=std --target=x86_64-unknown-haiku --features=std
322328

323329
clippy-fmt:
324330
name: Clippy + rustfmt

src/dragonfly.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use crate::{
1212
util_libc::{sys_fill_exact, Weak},
1313
Error,
1414
};
15-
use std::mem::MaybeUninit;
15+
use core::mem::MaybeUninit;
1616

1717
pub fn getrandom_inner(dest: &mut [MaybeUninit<u8>]) -> Result<(), Error> {
1818
static GETRANDOM: Weak = unsafe { Weak::new("getrandom\0") };
@@ -21,7 +21,9 @@ pub fn getrandom_inner(dest: &mut [MaybeUninit<u8>]) -> Result<(), Error> {
2121
// getrandom(2) was introduced in DragonflyBSD 5.7
2222
if let Some(fptr) = GETRANDOM.ptr() {
2323
let func: GetRandomFn = unsafe { core::mem::transmute(fptr) };
24-
return sys_fill_exact(dest, |buf| unsafe { func(buf.as_mut_ptr(), buf.len(), 0) });
24+
return sys_fill_exact(dest, |buf| unsafe {
25+
func(buf.as_mut_ptr() as *mut u8, buf.len(), 0)
26+
});
2527
} else {
2628
use_file::getrandom_inner(dest)
2729
}

src/openbsd.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
//! Implementation for OpenBSD
1010
use crate::{util_libc::last_os_error, Error};
11+
use core::mem::MaybeUninit;
1112

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

0 commit comments

Comments
 (0)