Skip to content

Commit

Permalink
do not attempt to open files in Miri (#121)
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung authored Sep 26, 2022
1 parent 5f1b033 commit 354348c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/linux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,11 @@ fn init_cgroups() {
// Should only be called once
debug_assert!(CGROUPS_CPUS.load(Ordering::SeqCst) == 0);

// Fails in Miri by default (cannot open files), and Miri does not have parallelism anyway.
if cfg!(miri) {
return;
}

if let Some(quota) = load_cgroups("/proc/self/cgroup", "/proc/self/mountinfo") {
if quota == 0 {
return;
Expand Down

0 comments on commit 354348c

Please sign in to comment.