Files
rust/library/std/src
bors e55c53c57e Auto merge of #97925 - the8472:cgroupv1, r=joshtriplett
Add cgroupv1 support to available_parallelism

Fixes #97549

My dev machine uses cgroup v2 so I was only able to test that code path. So the v1 code path is written only based on documentation. I could use some help testing that it works on a machine with cgroups v1:

```
$ x.py build --stage 1

# quota.rs
fn main() {
    println!("{:?}", std::thread::available_parallelism());
}

# assuming stage1 is linked in rustup
$ rust +stage1 quota.rs

# spawn a new cgroup scope for the current user
$ sudo systemd-run -p CPUQuota="300%" --uid=$(id -u) -tdS

# should print Ok(3)
$ ./quota
```

If it doesn't work as expected an strace, the contents of `/proc/self/cgroups` and the structure of `/sys/fs/cgroups` would help.
2022-07-23 13:33:56 +00:00
..
2021-10-25 22:44:41 -05:00
2022-07-18 15:06:07 +01:00
2022-05-27 07:36:17 -04:00
2022-03-23 05:33:44 +00:00
2022-06-26 16:31:29 +02:00
2022-04-14 01:33:13 -04:00
2022-05-24 19:41:40 -07:00
2022-05-23 00:02:09 +02:00