Skip to content

Commit

Permalink
make libc-misc pass under FreeBSD
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Nov 16, 2023
1 parent 23e5299 commit 7151eb1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ case $HOST_TARGET in
MIRI_TEST_TARGET=aarch64-unknown-linux-gnu run_tests
MIRI_TEST_TARGET=aarch64-apple-darwin run_tests
MIRI_TEST_TARGET=i686-pc-windows-gnu run_tests
MIRI_TEST_TARGET=x86_64-unknown-freebsd run_tests_minimal hello integer vec panic/panic concurrency/simple pthreads-threadname libc-getentropy libc-getrandom libc-reallocarray atomic env/var
MIRI_TEST_TARGET=x86_64-unknown-freebsd run_tests_minimal hello integer vec panic/panic concurrency/simple pthreads-threadname libc-getentropy libc-getrandom libc-reallocarray libc-misc atomic env/var
MIRI_TEST_TARGET=aarch64-linux-android run_tests_minimal hello integer vec panic/panic
MIRI_TEST_TARGET=wasm32-wasi run_tests_minimal no_std integer strings wasm
MIRI_TEST_TARGET=wasm32-unknown-unknown run_tests_minimal no_std integer strings wasm
Expand Down
7 changes: 7 additions & 0 deletions tests/pass-dep/shims/libc-misc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ fn test_thread_local_errno() {
}

/// Tests whether clock support exists at all
#[cfg(not(target_os = "freebsd"))]
fn test_clocks() {
let mut tp = std::mem::MaybeUninit::<libc::timespec>::uninit();
let is_error = unsafe { libc::clock_gettime(libc::CLOCK_REALTIME, tp.as_mut_ptr()) };
Expand Down Expand Up @@ -237,6 +238,7 @@ fn test_isatty() {
}
}

#[cfg(not(target_os = "freebsd"))]
fn test_posix_mkstemp() {
use std::ffi::CString;
use std::ffi::OsStr;
Expand Down Expand Up @@ -390,6 +392,8 @@ fn test_dlsym() {

fn main() {
test_posix_gettimeofday();

#[cfg(not(target_os = "freebsd"))] // FIXME we should support this on FreeBSD as well
test_posix_mkstemp();

test_posix_realpath_alloc();
Expand All @@ -399,7 +403,10 @@ fn main() {
test_thread_local_errno();

test_isatty();

#[cfg(not(target_os = "freebsd"))] // FIXME we should support this on FreeBSD as well
test_clocks();

test_dlsym();

test_memcpy();
Expand Down

0 comments on commit 7151eb1

Please sign in to comment.