summaryrefslogtreecommitdiff
path: root/cpus.h
blob: d672daa48f0ffe1e60e3d59d26ecfeb388bbbbff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#ifndef CPUS_H
#define CPUS_H

#include <unistd.h>

static inline int get_number_cpus(void)
{
	return sysconf(_SC_NPROCESSORS_CONF);
}

static inline int get_number_cpus_online(void)
{
	return sysconf(_SC_NPROCESSORS_ONLN);
}

#endif /* CPUS_H */