2019-11-15 14:14:28 +01:00
|
|
|
module runtime
|
|
|
|
|
2021-07-17 16:07:59 +02:00
|
|
|
fn C.sysconf(name int) i64
|
|
|
|
|
2020-12-27 19:14:43 +01:00
|
|
|
// nr_cpus returns the number of virtual CPU cores found on the system.
|
2020-07-20 16:36:44 +02:00
|
|
|
pub fn nr_cpus() int {
|
2022-01-19 18:29:29 +01:00
|
|
|
return int(C.sysconf(C._SC_NPROCESSORS_ONLN))
|
2020-12-27 19:14:43 +01:00
|
|
|
}
|