@@ -815,6 +815,11 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
815
815
this. handle_miri_start_unwind ( payload) ?;
816
816
return Ok ( EmulateItemResult :: NeedsUnwind ) ;
817
817
}
818
+ "getuid" => {
819
+ let [ ] = this. check_shim ( abi, Abi :: C { unwind : false } , link_name, args) ?;
820
+ // For now, just pretend we always have this fixed UID.
821
+ this. write_int ( UID , dest) ?;
822
+ }
818
823
819
824
// Incomplete shims that we "stub out" just to get pre-main initialization code to work.
820
825
// These shims are enabled only when the caller is in the standard library.
@@ -877,13 +882,6 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
877
882
this. write_null ( dest) ?;
878
883
}
879
884
880
- "getuid"
881
- if this. frame_in_std ( ) => {
882
- let [ ] = this. check_shim ( abi, Abi :: C { unwind : false } , link_name, args) ?;
883
- // For now, just pretend we always have this fixed UID.
884
- this. write_int ( super :: UID , dest) ?;
885
- }
886
-
887
885
"getpwuid_r" | "__posix_getpwuid_r"
888
886
if this. frame_in_std ( ) => {
889
887
// getpwuid_r is the standard name, __posix_getpwuid_r is used on solarish
@@ -898,7 +896,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
898
896
let result = this. deref_pointer ( result) ?;
899
897
900
898
// Must be for "us".
901
- if uid != crate :: shims :: unix :: UID {
899
+ if uid != UID {
902
900
throw_unsup_format ! ( "`getpwuid_r` on other users is not supported" ) ;
903
901
}
904
902
0 commit comments