diff options
| author | Ralf Jung <post@ralfj.de> | 2022-03-05 11:23:25 -0500 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2022-03-05 11:23:25 -0500 |
| commit | 51b4ea2ba1f4ee5dde7091858ac7807c72ffcb85 (patch) | |
| tree | 70b6c576cd479dafd5ee1ce6bbc7b774b2637fdd | |
| parent | c8a49fc90281d9a3227a547b5bac8e01d17325be (diff) | |
| download | rust-51b4ea2ba1f4ee5dde7091858ac7807c72ffcb85.tar.gz rust-51b4ea2ba1f4ee5dde7091858ac7807c72ffcb85.zip | |
do not attempt to open cgroup files under Miri
| -rw-r--r-- | library/std/src/sys/unix/thread.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/library/std/src/sys/unix/thread.rs b/library/std/src/sys/unix/thread.rs index ff01ce27333..2d5d306ed62 100644 --- a/library/std/src/sys/unix/thread.rs +++ b/library/std/src/sys/unix/thread.rs @@ -384,6 +384,11 @@ fn cgroup2_quota() -> usize { use crate::path::PathBuf; let mut quota = usize::MAX; + if cfg!(miri) { + // Attempting to open a file fails under default flags due to isolation. + // And Miri does not have parallelism anyway. + return quota; + } let _: Option<()> = try { let mut buf = Vec::with_capacity(128); |
