@@ -173,6 +173,10 @@ trait EvalContextExtPrivate<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, '
173
173
} else if file_type. is_symlink ( ) {
174
174
Ok ( this. eval_libc ( "DT_LNK" ) ?. to_u8 ( ) ? as i32 )
175
175
} else {
176
+ // Certain file types are only supported when the host is a Unix system.
177
+ // (i.e. devices and sockets) If it is, check those cases, if not, fall back to
178
+ // DT_UNKNOWN sooner.
179
+
176
180
#[ cfg( unix) ]
177
181
{
178
182
use std:: os:: unix:: fs:: FileTypeExt ;
@@ -895,6 +899,8 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
895
899
let c_ushort_layout = this. libc_ty_layout ( "c_ushort" ) ?;
896
900
let c_uchar_layout = this. libc_ty_layout ( "c_uchar" ) ?;
897
901
902
+ // If the host is a Unix system, fill in the inode number with its real value.
903
+ // If not, use 0 as a fallback value.
898
904
#[ cfg( unix) ]
899
905
let ino = std:: os:: unix:: fs:: DirEntryExt :: ino ( & dir_entry) ;
900
906
#[ cfg( not( unix) ) ]
@@ -969,6 +975,8 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
969
975
let c_ushort_layout = this. libc_ty_layout ( "c_ushort" ) ?;
970
976
let c_uchar_layout = this. libc_ty_layout ( "c_uchar" ) ?;
971
977
978
+ // If the host is a Unix system, fill in the inode number with its real value.
979
+ // If not, use 0 as a fallback value.
972
980
#[ cfg( unix) ]
973
981
let ino = std:: os:: unix:: fs:: DirEntryExt :: ino ( & dir_entry) ;
974
982
#[ cfg( not( unix) ) ]
0 commit comments