Skip to content

Commit 354348c

Browse files
authored
do not attempt to open files in Miri (#121)
1 parent 5f1b033 commit 354348c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/linux.rs

+5
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,11 @@ fn init_cgroups() {
126126
// Should only be called once
127127
debug_assert!(CGROUPS_CPUS.load(Ordering::SeqCst) == 0);
128128

129+
// Fails in Miri by default (cannot open files), and Miri does not have parallelism anyway.
130+
if cfg!(miri) {
131+
return;
132+
}
133+
129134
if let Some(quota) = load_cgroups("/proc/self/cgroup", "/proc/self/mountinfo") {
130135
if quota == 0 {
131136
return;

0 commit comments

Comments
 (0)