diff options
| author | Edward Tomasz Napierala <trasz@FreeBSD.org> | 2018-11-19 18:24:08 +0000 |
|---|---|---|
| committer | Edward Tomasz Napierala <trasz@FreeBSD.org> | 2018-11-19 18:24:08 +0000 |
| commit | a4f02d5d6d89fd2f0f40311d6902edab176a4bbb (patch) | |
| tree | ae549ff1c7c1242c1287b131c2e5cefea62d5df9 /lib/libthr/thread | |
| parent | 3a9cdc513257af5364923bd027aec0fa27a337cd (diff) | |
Notes
Diffstat (limited to 'lib/libthr/thread')
| -rw-r--r-- | lib/libthr/thread/thr_init.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/libthr/thread/thr_init.c b/lib/libthr/thread/thr_init.c index 65f7d111f73df..4781f8956c486 100644 --- a/lib/libthr/thread/thr_init.c +++ b/lib/libthr/thread/thr_init.c @@ -474,8 +474,9 @@ init_private(void) PANIC("Cannot get stack rlimit"); _thr_stack_initial = rlim.rlim_cur; } - len = sizeof(_thr_is_smp); - sysctlbyname("kern.smp.cpus", &_thr_is_smp, &len, NULL, 0); + _thr_is_smp = sysconf(_SC_NPROCESSORS_CONF); + if (_thr_is_smp == -1) + PANIC("Cannot get _SC_NPROCESSORS_CONF"); _thr_is_smp = (_thr_is_smp > 1); _thr_page_size = getpagesize(); _thr_guard_default = _thr_page_size; |
