Skip to content

Commit 51b4ea2

Browse files
committed
do not attempt to open cgroup files under Miri
1 parent c8a49fc commit 51b4ea2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

library/std/src/sys/unix/thread.rs

+5
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,11 @@ fn cgroup2_quota() -> usize {
384384
use crate::path::PathBuf;
385385

386386
let mut quota = usize::MAX;
387+
if cfg!(miri) {
388+
// Attempting to open a file fails under default flags due to isolation.
389+
// And Miri does not have parallelism anyway.
390+
return quota;
391+
}
387392

388393
let _: Option<()> = try {
389394
let mut buf = Vec::with_capacity(128);

0 commit comments

Comments
 (0)