diff --git a/src/shims/unix/fs.rs b/src/shims/unix/fs.rs index 7d60273232..bf99412af6 100644 --- a/src/shims/unix/fs.rs +++ b/src/shims/unix/fs.rs @@ -605,7 +605,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> { // (Technically we do not support *not* setting this flag, but we ignore that.) mirror |= o_cloexec; } - if cfg!(target_os = "linux") { + if this.tcx.sess.target.os == "linux" { let o_tmpfile = this.eval_libc_i32("O_TMPFILE")?; if flag & o_tmpfile != 0 { // if the flag contains `O_TMPFILE` then we return a graceful error