From a39a5f8189f925bf6a3131af28801903a8143fd2 Mon Sep 17 00:00:00 2001 From: David Cook Date: Tue, 28 Jan 2020 19:57:56 -0600 Subject: [PATCH] Disable posix_fadvise test on macOS, not in libc --- tests/run-pass/libc.rs | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/tests/run-pass/libc.rs b/tests/run-pass/libc.rs index 25f96b472b23..eb23cd16b757 100644 --- a/tests/run-pass/libc.rs +++ b/tests/run-pass/libc.rs @@ -5,13 +5,14 @@ extern crate libc; -use std::convert::TryInto; -use std::env::temp_dir; -use std::fs::{File, remove_file}; -use std::io::Write; -use std::os::unix::io::AsRawFd; +#[cfg(not(target_os = "macos"))] +fn test_posix_fadvise() { + use std::convert::TryInto; + use std::env::temp_dir; + use std::fs::{File, remove_file}; + use std::io::Write; + use std::os::unix::io::AsRawFd; -fn main() { let path = temp_dir().join("miri_test_libc.txt"); // Cleanup before test remove_file(&path).ok(); @@ -34,3 +35,8 @@ fn main() { remove_file(&path).unwrap(); assert_eq!(result, 0); } + +fn main() { + #[cfg(not(target_os = "macos"))] + test_posix_fadvise(); +}