4 * Copyright 2011 (c) - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
6 * Dual LGPL v2.1/GPL v2 license.
14 int __num_possible_cpus
;
16 void _get_num_possible_cpus(void)
20 /* On Linux, when some processors are offline
21 * _SC_NPROCESSORS_CONF counts the offline
22 * processors, whereas _SC_NPROCESSORS_ONLN
23 * does not. If we used _SC_NPROCESSORS_ONLN,
24 * getcpu() could return a value greater than
25 * this sysconf, in which case the arrays
26 * indexed by processor would overflow.
28 result
= sysconf(_SC_NPROCESSORS_CONF
);
31 __num_possible_cpus
= result
;
This page took 0.030178 seconds and 4 git commands to generate.