aboutsummaryrefslogtreecommitdiff
path: root/lib/libthr/thread/thr_stack.c
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2022-09-12 20:24:55 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2022-09-16 20:23:59 +0000
commitebf7a01594eeb8c2897d1b310069df35da112413 (patch)
treeed1944c569952f927f925d316b9d36276c268c51 /lib/libthr/thread/thr_stack.c
parent0ae364adcd8d34bda3fe1a32e86025ba96df058a (diff)
Diffstat (limited to 'lib/libthr/thread/thr_stack.c')
-rw-r--r--lib/libthr/thread/thr_stack.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/libthr/thread/thr_stack.c b/lib/libthr/thread/thr_stack.c
index b08bafdd9417..af396fe2ba93 100644
--- a/lib/libthr/thread/thr_stack.c
+++ b/lib/libthr/thread/thr_stack.c
@@ -30,7 +30,7 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <sys/types.h>
+#include <sys/param.h>
#include <sys/mman.h>
#include <sys/queue.h>
#include <sys/resource.h>
@@ -155,8 +155,7 @@ singlethread_map_stacks_exec(void)
mib[0] = CTL_KERN;
mib[1] = KERN_USRSTACK;
len = sizeof(usrstack);
- if (sysctl(mib, sizeof(mib) / sizeof(mib[0]), &usrstack, &len, NULL, 0)
- == -1)
+ if (sysctl(mib, nitems(mib), &usrstack, &len, NULL, 0) == -1)
return;
if (getrlimit(RLIMIT_STACK, &rlim) == -1)
return;