mirror of
https://github.com/upa/mscp.git
synced 2026-02-14 17:24:42 +08:00
change indent from space to tab
This commit is contained in:
@@ -14,25 +14,25 @@
|
||||
#ifdef __APPLE__
|
||||
int nr_cpus()
|
||||
{
|
||||
int n;
|
||||
size_t size = sizeof(n);
|
||||
int n;
|
||||
size_t size = sizeof(n);
|
||||
|
||||
if (sysctlbyname("machdep.cpu.core_count", &n, &size, NULL, 0) != 0) {
|
||||
pr_err("failed to get number of cpu cores: %s\n", strerrno());
|
||||
return -1;
|
||||
}
|
||||
if (sysctlbyname("machdep.cpu.core_count", &n, &size, NULL, 0) != 0) {
|
||||
pr_err("failed to get number of cpu cores: %s\n", strerrno());
|
||||
return -1;
|
||||
}
|
||||
|
||||
return n;
|
||||
return n;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef linux
|
||||
int nr_cpus()
|
||||
{
|
||||
cpu_set_t cpu_set;
|
||||
if (sched_getaffinity(0, sizeof(cpu_set_t), &cpu_set) == 0)
|
||||
return CPU_COUNT(&cpu_set);
|
||||
return -1;
|
||||
cpu_set_t cpu_set;
|
||||
if (sched_getaffinity(0, sizeof(cpu_set_t), &cpu_set) == 0)
|
||||
return CPU_COUNT(&cpu_set);
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user