diff options
| author | Ralf Jung <post@ralfj.de> | 2024-06-23 08:41:18 +0200 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2024-06-23 08:41:18 +0200 |
| commit | 903a424ae2f9d1fc2c36718f71aa665c9507850a (patch) | |
| tree | 3a7212dac936e55e5549bce05b50a3d5f6194db8 | |
| parent | 6d9fd241aa9bee5972a45f7494720d6a118cace9 (diff) | |
| download | rust-903a424ae2f9d1fc2c36718f71aa665c9507850a.tar.gz rust-903a424ae2f9d1fc2c36718f71aa665c9507850a.zip | |
unix/foreign_items: move getpid to the right part of the file
| -rw-r--r-- | src/tools/miri/src/shims/unix/foreign_items.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/tools/miri/src/shims/unix/foreign_items.rs b/src/tools/miri/src/shims/unix/foreign_items.rs index 2282099fa0d..53ad40cfd2c 100644 --- a/src/tools/miri/src/shims/unix/foreign_items.rs +++ b/src/tools/miri/src/shims/unix/foreign_items.rs @@ -51,7 +51,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { // See `fn emulate_foreign_item_inner` in `shims/foreign_items.rs` for the general pattern. #[rustfmt::skip] match link_name.as_str() { - // Environment variables + // Environment related shims "getenv" => { let [name] = this.check_shim(abi, Abi::C { unwind: false }, link_name, args)?; let result = this.getenv(name)?; @@ -78,6 +78,11 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { let result = this.chdir(path)?; this.write_scalar(Scalar::from_i32(result), dest)?; } + "getpid" => { + let [] = this.check_shim(abi, Abi::C { unwind: false}, link_name, args)?; + let result = this.getpid()?; + this.write_scalar(Scalar::from_i32(result), dest)?; + } // File descriptors "read" => { @@ -583,11 +588,6 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { let ret = if complete { 0 } else { this.eval_libc_i32("ERANGE") }; this.write_int(ret, dest)?; } - "getpid" => { - let [] = this.check_shim(abi, Abi::C { unwind: false}, link_name, args)?; - let result = this.getpid()?; - this.write_scalar(Scalar::from_i32(result), dest)?; - } "getentropy" => { // This function is non-standard but exists with the same signature and behavior on // Linux, macOS, FreeBSD and Solaris/Illumos. |
