summaryrefslogtreecommitdiff
path: root/lib/libthr/thread/thr_init.c
diff options
context:
space:
mode:
authorDavid Xu <davidxu@FreeBSD.org>2006-08-08 04:42:41 +0000
committerDavid Xu <davidxu@FreeBSD.org>2006-08-08 04:42:41 +0000
commit6b73f08519fa37c41c8b036c411e070d7774346f (patch)
treeb35cd73f8796696f70ac2128fab255ddaa5c9969 /lib/libthr/thread/thr_init.c
parent079ba18aacdfcf95964c63db89d67099f695177f (diff)
Notes
Diffstat (limited to 'lib/libthr/thread/thr_init.c')
-rw-r--r--lib/libthr/thread/thr_init.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/libthr/thread/thr_init.c b/lib/libthr/thread/thr_init.c
index 1150985ed071..5d1aae5672fc 100644
--- a/lib/libthr/thread/thr_init.c
+++ b/lib/libthr/thread/thr_init.c
@@ -99,6 +99,7 @@ struct pthread_cond_attr _pthread_condattr_default = {
};
pid_t _thr_pid;
+int _thr_smp_cpus = 1;
size_t _thr_guard_default;
size_t _thr_stack_default = THR_STACK_DEFAULT;
size_t _thr_stack_initial = THR_STACK_INITIAL;
@@ -443,6 +444,8 @@ init_private(void)
len = sizeof (_usrstack);
if (sysctl(mib, 2, &_usrstack, &len, NULL, 0) == -1)
PANIC("Cannot get kern.usrstack from sysctl");
+ len = sizeof(_thr_smp_cpus);
+ sysctlbyname("kern.smp.cpus", &_thr_smp_cpus, &len, NULL, 0);
_thr_page_size = getpagesize();
_thr_guard_default = _thr_page_size;
_pthread_attr_default.guardsize_attr = _thr_guard_default;