summaryrefslogtreecommitdiff
path: root/libc/unistd/sysconf.c
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2009-08-05 22:56:03 +0200
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2009-08-05 22:56:03 +0200
commit4ae13b764d61fa9cf96414552f512b72f8b41aca (patch)
tree37c85bf47d11fddee7baa9e14ca02551415e6ef5 /libc/unistd/sysconf.c
parentb24fcfb4858beef7d9114e2c4c5f10fc34b3182b (diff)
handle _SC_NPROCESSORS_CONF and _SC_NPROCESSORS_ONLN
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Diffstat (limited to 'libc/unistd/sysconf.c')
-rw-r--r--libc/unistd/sysconf.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/libc/unistd/sysconf.c b/libc/unistd/sysconf.c
index 37ccd4d63..82bcf2284 100644
--- a/libc/unistd/sysconf.c
+++ b/libc/unistd/sysconf.c
@@ -34,6 +34,16 @@
#include <regex.h>
#endif
+#ifdef HAVE_LINUX_CPUMASK_H
+# include <linux/cpumask.h>
+#endif
+#ifndef num_present_cpus
+# define num_present_cpus() (1)
+#endif
+#ifndef num_online_cpus
+# define num_online_cpus() (1)
+#endif
+
/* libc_hidden_proto(sysconf) */
/* libc_hidden_proto(getpagesize) */
@@ -658,20 +668,10 @@ long int sysconf(int name)
#endif
case _SC_NPROCESSORS_CONF:
-#if 0
- RETURN_FUNCTION(get_nprocs_conf());
-#else
- /* this is a hack. for now always claim we have exactly one cpu */
- return 1;
-#endif
+ RETURN_FUNCTION(num_present_cpus());
case _SC_NPROCESSORS_ONLN:
-#if 0
- RETURN_FUNCTION(get_nprocs());
-#else
- /* this is a hack. for now always claim we have exactly one cpu */
- return 1;
-#endif
+ RETURN_FUNCTION(num_online_cpus());
case _SC_PHYS_PAGES:
#if 0