@@ -704,7 +704,9 @@ pub fn page_size() -> usize {
704704//
705705// [posix_confstr]:
706706// 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) ) ) ]
708710fn confstr ( key : c_int , size_hint : Option < usize > ) -> io:: Result < OsString > {
709711 let mut buf: Vec < u8 > = Vec :: with_capacity ( 0 ) ;
710712 let mut bytes_needed_including_nul = size_hint
@@ -753,7 +755,7 @@ fn confstr(key: c_int, size_hint: Option<usize>) -> io::Result<OsString> {
753755 Ok ( OsString :: from_vec ( buf) )
754756}
755757
756- #[ cfg( target_vendor = "apple" ) ]
758+ #[ cfg( all ( target_vendor = "apple" , not ( miri ) ) ) ]
757759fn darwin_temp_dir ( ) -> PathBuf {
758760 confstr ( libc:: _CS_DARWIN_USER_TEMP_DIR, Some ( 64 ) ) . map ( PathBuf :: from) . unwrap_or_else ( |_| {
759761 // It failed for whatever reason (there are several possible reasons),
@@ -765,7 +767,7 @@ fn darwin_temp_dir() -> PathBuf {
765767pub fn temp_dir ( ) -> PathBuf {
766768 crate :: env:: var_os ( "TMPDIR" ) . map ( PathBuf :: from) . unwrap_or_else ( || {
767769 cfg_if:: cfg_if! {
768- if #[ cfg( target_vendor = "apple" ) ] {
770+ if #[ cfg( all ( target_vendor = "apple" , not ( miri ) ) ) ] {
769771 darwin_temp_dir( )
770772 } else if #[ cfg( target_os = "android" ) ] {
771773 PathBuf :: from( "/data/local/tmp" )
0 commit comments