summaryrefslogtreecommitdiff
path: root/sysdeps
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2014-04-19 23:15:38 +0400
committerIgor Pashev <pashev.igor@gmail.com>2014-04-19 23:17:49 +0400
commit0c13951b4684fe8a6eee0a88820a754903d520c4 (patch)
tree8fc03ab18717aa2579447f0994f5ad822614de2e /sysdeps
parentb63c0307bf57bf949240b43b170e2becbab29528 (diff)
downloadhtop-master.tar.gz
Use sysdep_number_of_cpus()HEADmaster
Fixed wrong value of this->cpuCount: htop now shows processes again and does not crash on exit.
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/linux.c6
-rw-r--r--sysdeps/solaris.c6
2 files changed, 12 insertions, 0 deletions
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);
+}