forked from external/yambar
modules: use portable function to count cpus
This commit is contained in:
parent
6c10eb2153
commit
8d91cbd8a3
1 changed files with 2 additions and 3 deletions
|
@ -9,8 +9,7 @@
|
|||
#include <string.h>
|
||||
#include <sys/time.h>
|
||||
#include <time.h>
|
||||
|
||||
#include <sys/sysinfo.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#define LOG_MODULE "cpu"
|
||||
#define LOG_ENABLE_DBG 0
|
||||
|
@ -57,7 +56,7 @@ description(struct module *mod)
|
|||
static uint32_t
|
||||
get_cpu_nb_cores()
|
||||
{
|
||||
int nb_cores = get_nprocs();
|
||||
int nb_cores = sysconf(_SC_NPROCESSORS_ONLN);
|
||||
LOG_DBG("CPU count: %d", nb_cores);
|
||||
|
||||
return nb_cores;
|
||||
|
|
Loading…
Add table
Reference in a new issue