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