From 07b826ed269a3fa089c7e6f2c0041501095a0ef9 Mon Sep 17 00:00:00 2001 From: deischen Date: Tue, 18 Dec 2001 02:02:59 +0000 Subject: [PATCH] Fix the retrieval of USRSTACK via sysctl so that it works for 64-bit archs. This should fix libc_r on alpha. Submitted by: Bernd Walter --- lib/libc_r/uthread/uthread_init.c | 4 ++-- lib/libkse/thread/thr_init.c | 4 ++-- lib/libpthread/thread/thr_init.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/libc_r/uthread/uthread_init.c b/lib/libc_r/uthread/uthread_init.c index 30ec765bfc2..cac38dc3f1d 100644 --- a/lib/libc_r/uthread/uthread_init.c +++ b/lib/libc_r/uthread/uthread_init.c @@ -269,9 +269,9 @@ _thread_init(void) /* Find the stack top */ mib[0] = CTL_KERN; mib[1] = KERN_USRSTACK; - len = sizeof (int); + len = sizeof (_usrstack); if (sysctl(mib, 2, &_usrstack, &len, NULL, 0) == -1) - _usrstack = USRSTACK; + _usrstack = (void *)USRSTACK; /* * Create a red zone below the main stack. All other stacks are * constrained to a maximum size by the paramters passed to diff --git a/lib/libkse/thread/thr_init.c b/lib/libkse/thread/thr_init.c index 30ec765bfc2..cac38dc3f1d 100644 --- a/lib/libkse/thread/thr_init.c +++ b/lib/libkse/thread/thr_init.c @@ -269,9 +269,9 @@ _thread_init(void) /* Find the stack top */ mib[0] = CTL_KERN; mib[1] = KERN_USRSTACK; - len = sizeof (int); + len = sizeof (_usrstack); if (sysctl(mib, 2, &_usrstack, &len, NULL, 0) == -1) - _usrstack = USRSTACK; + _usrstack = (void *)USRSTACK; /* * Create a red zone below the main stack. All other stacks are * constrained to a maximum size by the paramters passed to diff --git a/lib/libpthread/thread/thr_init.c b/lib/libpthread/thread/thr_init.c index 30ec765bfc2..cac38dc3f1d 100644 --- a/lib/libpthread/thread/thr_init.c +++ b/lib/libpthread/thread/thr_init.c @@ -269,9 +269,9 @@ _thread_init(void) /* Find the stack top */ mib[0] = CTL_KERN; mib[1] = KERN_USRSTACK; - len = sizeof (int); + len = sizeof (_usrstack); if (sysctl(mib, 2, &_usrstack, &len, NULL, 0) == -1) - _usrstack = USRSTACK; + _usrstack = (void *)USRSTACK; /* * Create a red zone below the main stack. All other stacks are * constrained to a maximum size by the paramters passed to -- 2.45.2