parseCpusAllowed static method
Reads the Cpus_allowed_list: line of /proc/self/status.
The list looks like 0-3,8,10-11. Returns null on bad input.
Implementation
static int? parseCpusAllowed(String? status) {
if (status == null) {
return null;
}
RegExpMatch? line = RegExp(
r'^Cpus_allowed_list:\s*(.+)$',
multiLine: true,
).firstMatch(status);
if (line == null) {
return null;
}
return parseCpuList(line.group(1)!.trim());
}