Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit fd11306

Browse files
authored
Merge pull request rust-lang#4179 from rayslava/master
allow code to call geteuid()
2 parents 8f11cc0 + 2d7f2ff commit fd11306

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/tools/miri/src/shims/unix/foreign_items.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -815,7 +815,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
815815
this.handle_miri_start_unwind(payload)?;
816816
return interp_ok(EmulateItemResult::NeedsUnwind);
817817
}
818-
"getuid" => {
818+
"getuid" | "geteuid" => {
819819
let [] = this.check_shim(abi, Conv::C, link_name, args)?;
820820
// For now, just pretend we always have this fixed UID.
821821
this.write_int(UID, dest)?;

src/tools/miri/tests/pass-dep/libc/libc-misc.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,16 @@ fn test_getuid() {
7878
let _val = unsafe { libc::getuid() };
7979
}
8080

81+
fn test_geteuid() {
82+
let _val = unsafe { libc::geteuid() };
83+
}
84+
8185
fn main() {
8286
test_thread_local_errno();
8387
test_environ();
8488
test_dlsym();
8589
test_getuid();
90+
test_geteuid();
8691

8792
#[cfg(target_os = "linux")]
8893
test_sigrt();

0 commit comments

Comments
 (0)