Commit 9c21872
committed
Auto merge of rust-lang#3716 - cgettys-microsoft:dev/cgettys/process_id_fixup-03, r=RalfJung
Remove GetCurrentProcessId's frame_in_std check
Most of the support required to close rust-lang#1727 was actually added a while back, in rust-lang#2215.
However, for some reason, even though the Unix/Linux syscall equivalent has no `frame_in_std()` check, the Windows `GetCurrentProcessId` check did. While the vast majority of use cases use `std::process::id`, there's no particular reason to penalize any Windows code that is no_std or for whatever other reason choses to call the function directly (e.g. via the generated [windows-sys](https://docs.rs/windows-sys/latest/windows_sys/Win32/System/Threading/fn.GetCurrentProcessId.html) method). The emulation should still work fine. Given there's no reason not to, we might as well simplify the code a tiny bit and save that branch / frame check during runtime too.
This PR removes the `frame_in_std` restriction for `GetCurrentProcessId`, and also moves it into the environment related shim section per discussion in rust-lang/miri#1727 (comment).
Still passes existing tests/pass/getpid.rs test.
Closes rust-lang#1727 unless we wish to give a dummy value when isolated, which we don't seem to want to do at this time.1 file changed
+5
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
141 | 146 | | |
142 | 147 | | |
143 | 148 | | |
| |||
743 | 748 | | |
744 | 749 | | |
745 | 750 | | |
746 | | - | |
747 | | - | |
748 | | - | |
749 | | - | |
750 | | - | |
751 | 751 | | |
752 | 752 | | |
753 | 753 | | |
| |||
0 commit comments