@@ -815,6 +815,11 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
815815 this. handle_miri_start_unwind ( payload) ?;
816816 return Ok ( EmulateItemResult :: NeedsUnwind ) ;
817817 }
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+ }
818823
819824 // Incomplete shims that we "stub out" just to get pre-main initialization code to work.
820825 // These shims are enabled only when the caller is in the standard library.
@@ -877,13 +882,6 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
877882 this. write_null ( dest) ?;
878883 }
879884
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-
887885 "getpwuid_r" | "__posix_getpwuid_r"
888886 if this. frame_in_std ( ) => {
889887 // getpwuid_r is the standard name, __posix_getpwuid_r is used on solarish
@@ -898,7 +896,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
898896 let result = this. deref_pointer ( result) ?;
899897
900898 // Must be for "us".
901- if uid != crate :: shims :: unix :: UID {
899+ if uid != UID {
902900 throw_unsup_format ! ( "`getpwuid_r` on other users is not supported" ) ;
903901 }
904902
0 commit comments