From 0c13951b4684fe8a6eee0a88820a754903d520c4 Mon Sep 17 00:00:00 2001 From: Igor Pashev Date: Sat, 19 Apr 2014 23:15:38 +0400 Subject: Use sysdep_number_of_cpus() Fixed wrong value of this->cpuCount: htop now shows processes again and does not crash on exit. --- sysdeps/linux.c | 6 ++++++ sysdeps/solaris.c | 6 ++++++ 2 files changed, 12 insertions(+) (limited to 'sysdeps') diff --git a/sysdeps/linux.c b/sysdeps/linux.c index 52b6e78..ab8710e 100644 --- a/sysdeps/linux.c +++ b/sysdeps/linux.c @@ -283,3 +283,9 @@ sysdep_uptime () } return (long) uptime; } + +int +sysdep_number_of_cpus () +{ + return sysconf (_SC_NPROCESSORS_ONLN); +} diff --git a/sysdeps/solaris.c b/sysdeps/solaris.c index 705ec9c..243975c 100644 --- a/sysdeps/solaris.c +++ b/sysdeps/solaris.c @@ -375,3 +375,9 @@ sysdep_uptime () } return uptime; } + +int +sysdep_number_of_cpus () +{ + return sysconf (_SC_NPROCESSORS_ONLN); +} -- cgit v1.2.3