@@ -704,7 +704,9 @@ pub fn page_size() -> usize {
704
704
//
705
705
// [posix_confstr]:
706
706
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/confstr.html
707
- #[ cfg( target_vendor = "apple" ) ]
707
+ //
708
+ // FIXME: Support `confstr` in Miri.
709
+ #[ cfg( all( target_vendor = "apple" , not( miri) ) ) ]
708
710
fn confstr ( key : c_int , size_hint : Option < usize > ) -> io:: Result < OsString > {
709
711
let mut buf: Vec < u8 > = Vec :: with_capacity ( 0 ) ;
710
712
let mut bytes_needed_including_nul = size_hint
@@ -753,7 +755,7 @@ fn confstr(key: c_int, size_hint: Option<usize>) -> io::Result<OsString> {
753
755
Ok ( OsString :: from_vec ( buf) )
754
756
}
755
757
756
- #[ cfg( target_vendor = "apple" ) ]
758
+ #[ cfg( all ( target_vendor = "apple" , not ( miri ) ) ) ]
757
759
fn darwin_temp_dir ( ) -> PathBuf {
758
760
confstr ( libc:: _CS_DARWIN_USER_TEMP_DIR, Some ( 64 ) ) . map ( PathBuf :: from) . unwrap_or_else ( |_| {
759
761
// It failed for whatever reason (there are several possible reasons),
@@ -765,7 +767,7 @@ fn darwin_temp_dir() -> PathBuf {
765
767
pub fn temp_dir ( ) -> PathBuf {
766
768
crate :: env:: var_os ( "TMPDIR" ) . map ( PathBuf :: from) . unwrap_or_else ( || {
767
769
cfg_if:: cfg_if! {
768
- if #[ cfg( target_vendor = "apple" ) ] {
770
+ if #[ cfg( all ( target_vendor = "apple" , not ( miri ) ) ) ] {
769
771
darwin_temp_dir( )
770
772
} else if #[ cfg( target_os = "android" ) ] {
771
773
PathBuf :: from( "/data/local/tmp" )
0 commit comments